Fix NetworkTable::ContainsKey.

Previously this would always return false due to how explicit bool is
evaluated in a return context.

Also add a test for this function.

Reported by: jcreigh
This commit is contained in:
Peter Johnson
2015-12-19 08:46:15 -08:00
parent e25d9fc96a
commit 7528b6b8bf
2 changed files with 21 additions and 1 deletions

View File

@@ -207,7 +207,7 @@ bool NetworkTable::ContainsKey(StringRef key) const {
llvm::SmallString<128> path(m_path);
path += PATH_SEPARATOR_CHAR;
path += key;
return !nt::GetEntryValue(path);
return nt::GetEntryValue(path) ? true : false;
}
bool NetworkTable::ContainsSubTable(StringRef key) const {