diff options
author | Vladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com> | 2021-01-20 03:49:24 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 12:49:24 -0800 |
commit | 75c859e98f360b07fa7168afcf1b3902c6a19540 (patch) | |
tree | 2b8a68110629e19e4d76e39ee08434999c2d5b52 /include | |
parent | 91b0958c43dd3165114b79dedcae48feddd67a81 (diff) | |
download | flatbuffers-75c859e98f360b07fa7168afcf1b3902c6a19540.tar.gz flatbuffers-75c859e98f360b07fa7168afcf1b3902c6a19540.tar.bz2 flatbuffers-75c859e98f360b07fa7168afcf1b3902c6a19540.zip |
[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.
Diffstat (limited to 'include')
-rw-r--r-- | include/flatbuffers/idl.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/flatbuffers/idl.h b/include/flatbuffers/idl.h index 1d57ba16..1a0e4a0f 100644 --- a/include/flatbuffers/idl.h +++ b/include/flatbuffers/idl.h @@ -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); |