diff --git a/src/project.cc b/src/project.cc index a73a6860..ef4e0c49 100644 --- a/src/project.cc +++ b/src/project.cc @@ -124,6 +124,8 @@ Project::Entry GetCompilationEntryFromCompileCommandEntry( } auto cleanup_maybe_relative_path = [&](const std::string& path) { + // TODO/FIXME: Normalization will fail for paths that do not exist. Should + // it return an optional? assert(!path.empty()); if (path[0] == '/' || entry.directory.empty()) return NormalizePathWithTestOptOut(path); diff --git a/src/query.cc b/src/query.cc index 94491ace..24ca7c55 100644 --- a/src/query.cc +++ b/src/query.cc @@ -603,7 +603,7 @@ IndexUpdate::IndexUpdate(const IdMap& previous_id_map, } void IndexUpdate::Merge(const IndexUpdate& update) { -// This function runs on an indexer thread. + // This function runs on an indexer thread. #define INDEX_UPDATE_APPEND(name) AddRange(&name, update.name); #define INDEX_UPDATE_MERGE(name) AddMergeableRange(&name, update.name); diff --git a/src/query.h b/src/query.h index bcb60db4..53b6d4e2 100644 --- a/src/query.h +++ b/src/query.h @@ -55,13 +55,13 @@ enum class SymbolKind : int { Invalid, File, Type, Func, Var }; MAKE_REFLECT_TYPE_PROXY(SymbolKind, int); namespace std { -template <> struct hash<::SymbolKind> { - size_t operator()(const ::SymbolKind &instance) const { +template <> +struct hash<::SymbolKind> { + size_t operator()(const ::SymbolKind& instance) const { return std::hash()(static_cast(instance)); } }; -} - +} // namespace std struct SymbolIdx { SymbolKind kind;