Skip to content

Commit 3c1ac60

Browse files
Applying code review.
1 parent 4255653 commit 3c1ac60

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

libsolidity/lsp/LanguageServer.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,31 +216,27 @@ void LanguageServer::changeConfiguration(Json::Value const& _settings)
216216

217217
if (jsonRemappings)
218218
{
219-
int typeFailureCount = 0;
219+
bool typeFailures = false;
220220
if (jsonRemappings.isArray())
221221
{
222222
vector<frontend::ImportRemapper::Remapping> remappings;
223223
for (Json::Value const& jsonPath: jsonRemappings)
224224
{
225225
if (jsonPath.isObject())
226-
{
227226
remappings.emplace_back(ImportRemapper::Remapping{
228227
jsonPath.get("context", "").asString(),
229228
jsonPath.get("prefix", "").asString(),
230229
jsonPath.get("target", "").asString(),
231230
});
232-
}
233231
else
234-
{
235-
typeFailureCount++;
236-
}
232+
typeFailures = true;
237233
}
238-
m_fileRepository.setRemappings(move(remappings));
234+
m_fileRepository.setRemappings(std::move(remappings));
239235
}
240236
else
241-
++typeFailureCount;
237+
typeFailures = true;
242238

243-
if (typeFailureCount)
239+
if (typeFailures)
244240
m_client.trace("Invalid JSON configuration passed. \"remappings\" should be of form [{\"context\":\"\", \"prefix\":\"foo\", \"target\":\"bar\"}].");
245241

246242
}

0 commit comments

Comments
 (0)