refactor: address comments

Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
This commit is contained in:
Stepan Bagritsevich 2025-05-06 20:07:04 +02:00
parent 66aabbff25
commit ba721d4cc5
No known key found for this signature in database
GPG key ID: 92DAADC9F15EE26E

View file

@ -409,7 +409,7 @@ std::optional<std::string> ConvertJsonPathToJsonPointer(string_view json_path) {
for (const auto& node : path) {
const auto& type = node.type();
if (type == json::SegmentType::IDENTIFIER) {
pointer += '/' + node.identifier();
absl::StrAppend(&pointer, "/"sv, node.identifier());
} else if (type == json::SegmentType::INDEX) {
const auto& index = node.index();
@ -419,7 +419,7 @@ std::optional<std::string> ConvertJsonPathToJsonPointer(string_view json_path) {
return std::nullopt;
}
pointer += '/' + std::to_string(node.index().first);
absl::StrAppend(&pointer, "/"sv, node.index().first);
} else {
VLOG(2) << "Error during conversion of JSONPath to JSONPointer: " << json_path
<< ". Unsupported segment type.";