Set prefix before if(withPrefix) so it will always have a value.
This commit is contained in:
parent
f4e8406f7c
commit
4fa21b4956
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue