mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-03 13:07:58 +00:00
Remove explicit empty-string check when looking up IdStrings
This commit is contained in:
parent
d70924ace2
commit
3a4fa325cc
2 changed files with 2 additions and 4 deletions
|
|
@ -64,9 +64,10 @@ void RTLIL::IdString::prepopulate()
|
||||||
{
|
{
|
||||||
int size = static_cast<short>(RTLIL::StaticId::STATIC_ID_END);
|
int size = static_cast<short>(RTLIL::StaticId::STATIC_ID_END);
|
||||||
global_id_storage_.reserve(size);
|
global_id_storage_.reserve(size);
|
||||||
RTLIL::IdString::global_id_storage_.push_back({const_cast<char*>(""), 0});
|
|
||||||
global_id_index_.reserve(size);
|
global_id_index_.reserve(size);
|
||||||
global_refcount_storage_.resize(size, 1);
|
global_refcount_storage_.resize(size, 1);
|
||||||
|
RTLIL::IdString::global_id_index_.insert({"", 0});
|
||||||
|
RTLIL::IdString::global_id_storage_.push_back({const_cast<char*>(""), 0});
|
||||||
#define X(N) populate("\\" #N);
|
#define X(N) populate("\\" #N);
|
||||||
#include "kernel/constids.inc"
|
#include "kernel/constids.inc"
|
||||||
#undef X
|
#undef X
|
||||||
|
|
|
||||||
|
|
@ -236,9 +236,6 @@ struct RTLIL::IdString
|
||||||
|
|
||||||
ensure_prepopulated();
|
ensure_prepopulated();
|
||||||
|
|
||||||
if (p.empty())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
log_assert(p[0] == '$' || p[0] == '\\');
|
log_assert(p[0] == '$' || p[0] == '\\');
|
||||||
for (char ch : p)
|
for (char ch : p)
|
||||||
if ((unsigned)ch <= (unsigned)' ')
|
if ((unsigned)ch <= (unsigned)' ')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue