Set prefix before if(withPrefix) so it will always have a value.

This commit is contained in:
arches 2016-07-04 06:45:55 -04:00
parent f4e8406f7c
commit 4fa21b4956
1 changed files with 2 additions and 2 deletions

View File

@ -7,9 +7,9 @@ etcdv3::AsyncGetAction::AsyncGetAction(std::string const & key, KV::Stub* stub_,
{ {
RangeRequest get_request; RangeRequest get_request;
get_request.set_key(key); get_request.set_key(key);
prefix = withPrefix;
if(withPrefix) if(withPrefix)
{ {
prefix = withPrefix;
std::string range_end(key); std::string range_end(key);
int ascii = (int)range_end[range_end.length()-1]; int ascii = (int)range_end[range_end.length()-1];
range_end.back() = ascii+1; range_end.back() = ascii+1;