Skip to content

Commit 8fc09a7

Browse files
ryuhei shimaryuhei shima
authored andcommitted
lint
1 parent 3a72667 commit 8fc09a7

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/inspector/dom_storage_agent.cc

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,28 +89,26 @@ protocol::DispatchResponse DOMStorageAgent::getDOMStorageItems(
8989
}
9090
bool is_local_storage = storageId->getIsLocalStorage();
9191
std::optional<StorageMap> storage_map =
92-
is_local_storage
93-
? std::make_optional<StorageMap>(local_storage_map_)
94-
: std::make_optional<StorageMap>(session_storage_map_);
92+
is_local_storage ? std::make_optional<StorageMap>(local_storage_map_)
93+
: std::make_optional<StorageMap>(session_storage_map_);
9594
if (storage_map->empty()) {
9695
auto web_storage_obj = getWebStorage(is_local_storage);
9796
if (web_storage_obj) {
9897
StorageMap all_items = web_storage_obj.value()->GetAll();
99-
storage_map =
100-
std::make_optional<StorageMap>(std::move(all_items));
98+
storage_map = std::make_optional<StorageMap>(std::move(all_items));
10199
}
102100
}
103101

104102
auto result =
105103
std::make_unique<protocol::Array<protocol::Array<protocol::String>>>();
106104
for (const auto& pair : *storage_map) {
107105
auto item = std::make_unique<protocol::Array<protocol::String>>();
108-
item->push_back(
109-
protocol::StringUtil::fromUTF16(reinterpret_cast<const uint16_t*>(pair.first.data()),
110-
pair.first.size()));
111-
item->push_back(
112-
protocol::StringUtil::fromUTF16(reinterpret_cast<const uint16_t*>(pair.second.data()),
113-
pair.second.size()));
106+
item->push_back(protocol::StringUtil::fromUTF16(
107+
reinterpret_cast<const uint16_t*>(pair.first.data()),
108+
pair.first.size()));
109+
item->push_back(protocol::StringUtil::fromUTF16(
110+
reinterpret_cast<const uint16_t*>(pair.second.data()),
111+
pair.second.size()));
114112
result->push_back(std::move(item));
115113
}
116114
*items = std::move(result);
@@ -255,11 +253,11 @@ void DOMStorageAgent::registerStorage(Local<Context> context,
255253
}
256254
node::TwoByteValue key_utf16(isolate, key_value);
257255
node::TwoByteValue value_utf16(isolate, value_value);
258-
storage_map[std::u16string(
259-
reinterpret_cast<const char16_t*>(*key_utf16), key_utf16.length())] =
256+
storage_map[std::u16string(reinterpret_cast<const char16_t*>(*key_utf16),
257+
key_utf16.length())] =
260258
std::u16string(reinterpret_cast<const char16_t*>(*value_utf16),
261259
value_utf16.length());
262-
}
260+
}
263261
}
264262

265263
std::optional<node::webstorage::Storage*> DOMStorageAgent::getWebStorage(

0 commit comments

Comments
 (0)