Commit f5c87f93 authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

[layoutng] Improve NGExclusionSpace::operator==

If neither space has exclusions, the two spaces are equal.

exclusions_ is a scoped_refptr, so operator== only compares pointer values.

Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: Iea67f268f9a537a27f267441f2afda860d641950
Reviewed-on: https://chromium-review.googlesource.com/1188847
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585994}
parent 27ebd00b
......@@ -585,6 +585,8 @@ const NGExclusionSpace::DerivedGeometry& NGExclusionSpace::GetDerivedGeometry()
}
bool NGExclusionSpace::operator==(const NGExclusionSpace& other) const {
if (num_exclusions_ == 0 && other.num_exclusions_ == 0)
return true;
return num_exclusions_ == other.num_exclusions_ &&
exclusions_ == other.exclusions_;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment