From 4fa21b49568964e7d1834a602e7846a8e8cb5744 Mon Sep 17 00:00:00 2001 From: arches Date: Mon, 4 Jul 2016 06:45:55 -0400 Subject: [PATCH] Set prefix before if(withPrefix) so it will always have a value. --- v3/src/AsyncGetAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v3/src/AsyncGetAction.cpp b/v3/src/AsyncGetAction.cpp index 16d0508..30fd2d3 100644 --- a/v3/src/AsyncGetAction.cpp +++ b/v3/src/AsyncGetAction.cpp @@ -7,9 +7,9 @@ etcdv3::AsyncGetAction::AsyncGetAction(std::string const & key, KV::Stub* stub_, { RangeRequest get_request; get_request.set_key(key); + prefix = withPrefix; if(withPrefix) { - prefix = withPrefix; std::string range_end(key); int ascii = (int)range_end[range_end.length()-1]; range_end.back() = ascii+1; @@ -38,6 +38,6 @@ etcdv3::AsyncRangeResponse etcdv3::AsyncGetAction::ParseResponse() range_resp.action = etcdv3::GET_ACTION; range_resp.isPrefix = prefix; } - + return range_resp; }