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;
|
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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue