Skip to content

Commit

Permalink
Internal Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 540323049
  • Loading branch information
Googler authored and banaag committed Sep 1, 2023
1 parent 6e5f836 commit 5cf8be5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions validator/cpp/engine/validator-internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,9 @@ struct ParsedReferencePoint {
class ParsedReferencePoints {
public:
ParsedReferencePoints() : parent_(nullptr) {}
ParsedReferencePoints(
const TagSpec& parent,
const unordered_map<std::string, int32_t>& tag_spec_ids_by_tag_spec_name)
ParsedReferencePoints(const TagSpec& parent,
const absl::flat_hash_map<std::string, int32_t>&
tag_spec_ids_by_tag_spec_name)
: parent_(&parent) {
for (const ReferencePoint& p : parent.reference_points()) {
auto iter = tag_spec_ids_by_tag_spec_name.find(p.tag_spec_name());
Expand Down Expand Up @@ -1041,11 +1041,11 @@ RecordValidated ShouldRecordTagspecValidated(
// which is unique within its context, the ParsedValidatorRules.
class ParsedTagSpec {
public:
ParsedTagSpec(
ParsedAttrSpecs* parsed_attr_specs,
const unordered_map<std::string, int32_t>& tag_spec_ids_by_tag_spec_name,
RecordValidated should_record_tagspec_validated, const TagSpec* spec,
int32_t id)
ParsedTagSpec(ParsedAttrSpecs* parsed_attr_specs,
const absl::flat_hash_map<std::string, int32_t>&
tag_spec_ids_by_tag_spec_name,
RecordValidated should_record_tagspec_validated,
const TagSpec* spec, int32_t id)
: spec_(spec),
id_(id),
reference_points_(*spec, tag_spec_ids_by_tag_spec_name),
Expand Down Expand Up @@ -1218,7 +1218,7 @@ class ParsedTagSpec {

const set<int32_t>& implicit_attrspecs() const { return implicit_attrspecs_; }

const unordered_map<std::string, int32_t>& attr_ids_by_name() const {
const absl::flat_hash_map<std::string, int32_t>& attr_ids_by_name() const {
return attr_ids_by_name_;
}

Expand All @@ -1240,7 +1240,7 @@ class ParsedTagSpec {
bool is_reference_point_;
bool is_type_json_ = false;
bool contains_url_ = false;
unordered_map<std::string, int32_t> attr_ids_by_name_;
absl::flat_hash_map<std::string, int32_t> attr_ids_by_name_;
vector<TypeIdentifier> disabled_by_;
vector<TypeIdentifier> enabled_by_;
vector<int32_t> mandatory_attr_ids_;
Expand Down Expand Up @@ -2476,7 +2476,7 @@ class Context {
if (!tag_result.best_match_tag_spec) return;
const ParsedTagSpec* parsed_tag_spec = tag_result.best_match_tag_spec;
if (!parsed_tag_spec->AttrsCanSatisfyExtension()) return;
const unordered_map<std::string, int32_t>& attr_ids_by_name =
const absl::flat_hash_map<std::string, int32_t>& attr_ids_by_name =
parsed_tag_spec->attr_ids_by_name();
ExtensionsContext* extensions_ctx = mutable_extensions();
for (const ParsedHtmlTagAttr& attr : encountered_tag.Attributes()) {
Expand Down Expand Up @@ -4412,7 +4412,7 @@ void ValidateAttributes(const ParsedTagSpec& parsed_tag_spec,
set<std::string_view> mandatory_anyofs_seen;
vector<const ParsedAttrTriggerSpec*> parsed_trigger_specs;
set<int32_t> attrspecs_validated;
const unordered_map<std::string, int32_t>& attr_ids_by_name =
const absl::flat_hash_map<std::string, int32_t>& attr_ids_by_name =
parsed_tag_spec.attr_ids_by_name();

for (const ParsedHtmlTagAttr& attr : encountered_tag.Attributes()) {
Expand Down Expand Up @@ -4717,7 +4717,7 @@ ParsedValidatorRules::ParsedValidatorRules(HtmlFormat::Code html_format)
// |tag_spec_names_to_track| to identify those tagspecs that are
// referenced by others via "also_requires_tag". The ParsedTagSpec
// constructor completes this translation to ids.
unordered_map<std::string, int32_t> tag_spec_ids_by_tag_spec_name;
absl::flat_hash_map<std::string, int32_t> tag_spec_ids_by_tag_spec_name;
unordered_set<std::string> tag_spec_names_to_track;
for (int ii = 0; ii < rules_.tags_size(); ++ii) {
const TagSpec& tag = rules_.tags(ii);
Expand Down

0 comments on commit 5cf8be5

Please sign in to comment.