Skip to content

Commit a257a6a

Browse files
committed
Remove unnecessary uses of ""
Appending "" to a string has no effect.
1 parent 9aac51d commit a257a6a

File tree

13 files changed

+22
-37
lines changed

13 files changed

+22
-37
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,7 @@ std::string expr2ct::convert_rec(
477477

478478
if(parameters.empty())
479479
{
480-
if(code_type.has_ellipsis())
481-
dest+=""; // empty!
482-
else
480+
if(!code_type.has_ellipsis())
483481
dest+="void"; // means 'no parameters'
484482
}
485483
else

src/cbmc/all_properties_class.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class bmc_all_propertiest:
5959

6060
// make some poor compilers happy
6161
UNREACHABLE;
62-
return "";
6362
}
6463

6564
explicit goalt(

src/cpp/parse.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,8 @@ bool Parser::rNamespaceSpec(cpp_namespace_spect &namespace_spec)
841841

842842
irep_idt name;
843843

844-
if(lex.LookAhead(0)=='{')
845-
name=""; // an anonymous namespace
846-
else
844+
// namespace might be anonymous
845+
if(lex.LookAhead(0) != '{')
847846
{
848847
if(lex.get_token(tk2)==TOK_IDENTIFIER)
849848
name=tk2.data.get(ID_C_base_name);

src/goto-instrument/dot.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ void dott::write_dot_subgraph(
192192
std::set<goto_programt::const_targett> fres;
193193
find_next(instructions, it, tres, fres);
194194

195-
std::string tlabel="true";
196-
std::string flabel="false";
197-
if(fres.empty() || tres.empty())
195+
std::string tlabel;
196+
std::string flabel;
197+
if(!fres.empty() && !tres.empty())
198198
{
199-
tlabel="";
200-
flabel="";
199+
tlabel = "true";
200+
flabel = "false";
201201
}
202202

203203
typedef std::set<goto_programt::const_targett> t;

src/goto-programs/property_checker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ std::string property_checkert::as_string(resultt result)
2121
case property_checkert::resultt::UNKNOWN: return "UNKNOWN";
2222
}
2323

24-
return "";
24+
UNREACHABLE;
2525
}
2626

2727
property_checkert::property_checkert(

src/goto-symex/partial_order_concurrency.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ irep_idt partial_order_concurrencyt::rw_clock_id(
133133
return id2string(id(event))+"$rclk$"+std::to_string(axiom);
134134
else
135135
UNREACHABLE;
136-
137-
return "";
138136
}
139137

140138
symbol_exprt partial_order_concurrencyt::clock(

src/pointer-analysis/value_set.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void value_sett::output(
150150
result="<"+from_expr(ns, identifier, o)+", ";
151151

152152
if(o_it->second)
153-
result += integer2string(*o_it->second) + "";
153+
result += integer2string(*o_it->second);
154154
else
155155
result+='*';
156156

src/pointer-analysis/value_set_fi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void value_set_fit::output(
102102
result="<"+from_expr(ns, identifier, o)+", ";
103103

104104
if(o_it->second)
105-
result += integer2string(*o_it->second) + "";
105+
result += integer2string(*o_it->second);
106106
else
107107
result+='*';
108108

src/pointer-analysis/value_set_fivr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void value_set_fivrt::output(
143143
result+=from_expr(ns, identifier, o)+", ";
144144

145145
if(o_it->second)
146-
result += integer2string(*o_it->second) + "";
146+
result += integer2string(*o_it->second);
147147
else
148148
result+='*';
149149

src/pointer-analysis/value_set_fivrns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void value_set_fivrnst::output_entry(
134134
result+=from_expr(ns, identifier, o)+", ";
135135

136136
if(o_it->second)
137-
result += integer2string(*o_it->second) + "";
137+
result += integer2string(*o_it->second);
138138
else
139139
result+='*';
140140

0 commit comments

Comments
 (0)