assignDkeys: use flat_set<ReportID>, not set

This commit is contained in:
Justin Viiret
2015-12-02 10:39:32 +11:00
committed by Matthew Barr
parent 8dac64d1dc
commit da23e8306a
5 changed files with 20 additions and 15 deletions

View File

@@ -894,7 +894,8 @@ bool is_equal(const CastleProto &c1, const CastleProto &c2) {
return c1.repeats == c2.repeats;
}
bool requiresDedupe(const CastleProto &proto, const set<ReportID> &reports) {
bool requiresDedupe(const CastleProto &proto,
const ue2::flat_set<ReportID> &reports) {
ue2::unordered_set<ReportID> seen;
for (const PureRepeat &pr : proto.repeats | map_values) {
for (const ReportID &report : pr.reports) {

View File

@@ -38,6 +38,7 @@
#include "nfagraph/ng_repeat.h"
#include "util/alloc.h"
#include "util/depth.h"
#include "util/ue2_containers.h"
#include <map>
#include <memory>
@@ -135,7 +136,8 @@ bool is_equal(const CastleProto &c1, const CastleProto &c2);
* \brief True if the given castle contains more than a single instance of any
* of the reports in the given set.
*/
bool requiresDedupe(const CastleProto &proto, const std::set<ReportID> &reports);
bool requiresDedupe(const CastleProto &proto,
const ue2::flat_set<ReportID> &reports);
/**
* \brief Build an NGHolder from a CastleProto.