Commit b9447657 authored by zhujiashun's avatar zhujiashun

support_kv_pair_splitter: refine code

parent 42435e74
...@@ -208,7 +208,7 @@ public: ...@@ -208,7 +208,7 @@ public:
// Get the current value of key and value // Get the current value of key and value
// in the format of "key=value" // in the format of "key=value"
inline StringPiece key_and_value(){ inline StringPiece key_and_value() {
return StringPiece(_sp.field(), _sp.length()); return StringPiece(_sp.field(), _sp.length());
} }
......
...@@ -317,7 +317,7 @@ int StringMultiSplitter::to_double(double* pv) const { ...@@ -317,7 +317,7 @@ int StringMultiSplitter::to_double(double* pv) const {
} }
void KeyValuePairsSplitter::UpdateDelimiterPosition() { void KeyValuePairsSplitter::UpdateDelimiterPosition() {
StringPiece key_value_pair(_sp.field(), _sp.length()); const StringPiece key_value_pair(key_and_value());
_deli_pos = key_value_pair.find(_key_value_delimiter); _deli_pos = key_value_pair.find(_key_value_delimiter);
if (_deli_pos == StringPiece::npos) { if (_deli_pos == StringPiece::npos) {
_deli_pos = key_value_pair.length(); _deli_pos = key_value_pair.length();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment