summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-02 19:08:02 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-02 19:08:02 +0200
commit8e7361f128ce00a742412931efcf7cbe5795a39a (patch)
treec3dc8f179ba5c9b5ce0ea9791d37476d42d26dde /kernel
parent04727c7e0fb4c00b38999da192e4ada2a6f9474a (diff)
Removed at() method from RTLIL::IdString
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc4
-rw-r--r--kernel/rtlil.h9
2 files changed, 6 insertions, 7 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index 2838449b..56c631f3 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -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__);
}
}
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 502969a1..ab15024e 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -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 {