Profile and optimize

- Eliminate unnecessary copies of grammar objects
- Do cheaper comparisons first in equality methods
This commit is contained in:
Max Brunsfeld 2014-04-23 08:32:11 -07:00
parent 68d44fd565
commit 3b388d66cd
7 changed files with 20 additions and 22 deletions

View file

@ -23,7 +23,7 @@ namespace tree_sitter {
}
size_t ISymbol::hash_code() const {
return hash<size_t>()(index) ^ hash<int16_t>()(options);
return hash<int>()(index) ^ hash<int16_t>()(options);
}
rule_ptr ISymbol::copy() const {