From d45223976ab4e9ed4b7d3d1973d3379d89d54e6c Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Wed, 1 Oct 2025 02:47:47 +0000 Subject: [PATCH] Optimize `IdString::empty()` I actually saw this take 0.6% of the time in an `opt_clean` pass (under Module::check()). Trivial issue, but the fix is also trivial and simple. --- kernel/rtlil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rtlil.h b/kernel/rtlil.h index 5271a3111..9f636c5a2 100644 --- a/kernel/rtlil.h +++ b/kernel/rtlil.h @@ -411,7 +411,7 @@ struct RTLIL::IdString } bool empty() const { - return c_str()[0] == 0; + return index_ == 0; } void clear() {