Skip to content

Commit 582af47

Browse files
committed
Use a canonical way to test for an empty string.
Testing for empty strings or containers with empty() is always the best and canonical choice. Signed-off-by: Henner Zeller <[email protected]>
1 parent e71ace5 commit 582af47

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ql-qlf-plugin/synth_quicklogic.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ struct SynthQuickLogicPass : public ScriptPass {
314314
run("techmap -map +/mul2dsp.v [...]", " (for qlf_k6n10f if not -no_dsp)");
315315
run("chtype -set $mul t:$__soft_mul", " (for qlf_k6n10f if not -no_dsp)");
316316
run("techmap -map +/quicklogic/" + family + "/dsp_map.v", "(for qlf_k6n10f if not -no_dsp)");
317-
if (use_dsp_cfg_params == "")
317+
if (use_dsp_cfg_params.empty())
318318
run("techmap -map +/quicklogic/" + family + "/dsp_map.v -D USE_DSP_CFG_PARAMS=0", "(for qlf_k6n10f if not -no_dsp)");
319319
else
320320
run("techmap -map +/quicklogic/" + family + "/dsp_map.v -D USE_DSP_CFG_PARAMS=1", "(for qlf_k6n10f if not -no_dsp)");
@@ -334,7 +334,7 @@ struct SynthQuickLogicPass : public ScriptPass {
334334
rule.a_maxwidth, rule.b_maxwidth, rule.a_minwidth, rule.b_minwidth, rule.type.c_str()));
335335
run("chtype -set $mul t:$__soft_mul");
336336
}
337-
if (use_dsp_cfg_params == "")
337+
if (use_dsp_cfg_params.empty())
338338
run("techmap -map +/quicklogic/" + family + "/dsp_map.v -D USE_DSP_CFG_PARAMS=0");
339339
else
340340
run("techmap -map +/quicklogic/" + family + "/dsp_map.v -D USE_DSP_CFG_PARAMS=1");

systemverilog-plugin/UhdmAst.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3638,7 +3638,7 @@ void UhdmAst::process_repeat()
36383638
if (node->type != AST::AST_BLOCK) {
36393639
node = new AST::AstNode(AST::AST_BLOCK, node);
36403640
}
3641-
if (node->str == "") {
3641+
if (node->str.empty()) {
36423642
node->str = loop->str; // Needed in simplify step
36433643
}
36443644
loop->children.push_back(node);

0 commit comments

Comments
 (0)