mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-10 07:06:26 +00:00
[idl_parser] Improve symbols lookup thru parent namespaces (#6407)
Added the new method LookupTableByName for searching symbols in parent namespaces. This method speedup (x50 or greater) symbol resolution (enum or struct) in parent namespaces. The speedup was measured without `table.empty()` guard condition. This method should suppress fuzzer timeout issue without artificial limits for nested namespaces (https://oss-fuzz.com/testcase-detail/6244168439169024). Additionally, this commit speedup (x5) the GetFullyQualifiedName method by removing unnecessary temporary std::string object.
This commit is contained in:
@@ -856,6 +856,7 @@ class Parser : public ParserState {
|
||||
flexbuffers::Builder *builder);
|
||||
|
||||
StructDef *LookupStruct(const std::string &id) const;
|
||||
StructDef *LookupStructThruParentNamespaces(const std::string &id) const;
|
||||
|
||||
std::string UnqualifiedName(const std::string &fullQualifiedName);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user