3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 17:15:33 +00:00

Further cleanup based on @daveshah1

This commit is contained in:
Eddie Hung 2019-06-14 12:25:06 -07:00
parent 97d2656375
commit a48b5bfaa5
4 changed files with 47 additions and 47 deletions

View file

@ -276,6 +276,12 @@ namespace RTLIL
return std::string(c_str() + pos, len);
}
bool begins_with(const char* prefix) const {
size_t len = strlen(prefix);
if (size() < len) return false;
return substr(0, len) == prefix;
}
bool ends_with(const char* suffix) const {
size_t len = strlen(suffix);
if (size() < len) return false;