Removed at() method from RTLIL::IdString
authorClifford Wolf <clifford@clifford.at>
Sat, 2 Aug 2014 17:08:02 +0000 (19:08 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 2 Aug 2014 17:08:02 +0000 (19:08 +0200)
kernel/rtlil.cc
kernel/rtlil.h
passes/sat/expose.cc

index 2838449bbf68e1c2b991f10e2324a15d479ff18f..56c631f3b07d678e0c1d3bb1d5197be95754fb57 100644 (file)
@@ -490,9 +490,9 @@ namespace {
                        }
 
                        for (auto &conn : cell->connections()) {
-                               if (conn.first.size() != 2 || conn.first.at(0) != '\\')
+                               if (conn.first.size() != 2 || conn.first[0] != '\\')
                                        error(__LINE__);
-                               if (strchr(ports, conn.first.at(1)) == NULL)
+                               if (strchr(ports, conn.first[1]) == NULL)
                                        error(__LINE__);
                        }
                }
index 502969a1f01a6304f40efd14e193bc63dc38a79b..ab15024e0fbb6a8e40a58b0708ad433b46fa1802 100644 (file)
@@ -185,12 +185,11 @@ namespace RTLIL
                bool operator==(const char *rhs) const { return str() == rhs; }
                bool operator!=(const char *rhs) const { return str() != rhs; }
 
-               char at(size_t i) const {
-                       return c_str()[i];
-               }
-
                char operator[](size_t i) const {
-                       return c_str()[i];
+                       const char *p = c_str();
+                       for (; i != 0; i--, p++) 
+                               log_assert(*p != 0);
+                       return *p;
                }
 
                std::string substr(size_t pos = 0, size_t len = std::string::npos) const {
index affd685e442acb35d23663794b6b2d5a3d69a7d0..e856fdf76d5bd85dbc760f1e5dc76ea592797241 100644 (file)
@@ -50,7 +50,7 @@ static bool consider_cell(RTLIL::Design *design, std::set<RTLIL::IdString> &dff_
 {
        if (cell->name[0] == '$' || dff_cells.count(cell->name))
                return false;
-       if (cell->type.at(0) == '\\' && !design->modules_.count(cell->type))
+       if (cell->type[0] == '\\' && !design->modules_.count(cell->type))
                return false;
        return true;
 }