rtlil: change IdString comparison operators to take references instead of copies
authorRick Altherr <kc8apf@kc8apf.net>
Sat, 30 Jan 2016 06:40:17 +0000 (22:40 -0800)
committerRick Altherr <kc8apf@kc8apf.net>
Sat, 30 Jan 2016 07:06:40 +0000 (23:06 -0800)
kernel/rtlil.h

index 7b669536ed46ff2e7a22274a6bf197bf8740aa66..0444834acf3914cf6d3422eed27e38a69e36c38d 100644 (file)
@@ -192,12 +192,12 @@ namespace RTLIL
                        return std::string(global_id_storage_.at(index_));
                }
 
-               bool operator<(IdString rhs) const {
+               bool operator<(const IdString &rhs) const {
                        return index_ < rhs.index_;
                }
 
-               bool operator==(IdString rhs) const { return index_ == rhs.index_; }
-               bool operator!=(IdString rhs) const { return index_ != rhs.index_; }
+               bool operator==(const IdString &rhs) const { return index_ == rhs.index_; }
+               bool operator!=(const IdString &rhs) const { return index_ != rhs.index_; }
 
                // The methods below are just convenience functions for better compatibility with std::string.