Skip to content

Commit 59d1c9a

Browse files
committed
Remove unnecessary uses of ""
Appending "" to a string has no effect.
1 parent bc3c113 commit 59d1c9a

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
@@ -510,9 +510,7 @@ std::string expr2ct::convert_rec(
510510

511511
if(parameters.empty())
512512
{
513-
if(code_type.has_ellipsis())
514-
dest+=""; // empty!
515-
else
513+
if(!code_type.has_ellipsis())
516514
dest+="void"; // means 'no parameters'
517515
}
518516
else

src/cbmc/all_properties_class.h

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

5959
// make some poor compilers happy
6060
UNREACHABLE;
61-
return "";
6261
}
6362

6463
explicit goalt(

src/cpp/parse.cpp

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

838838
irep_idt name;
839839

840-
if(lex.LookAhead(0)=='{')
841-
name=""; // an anonymous namespace
842-
else
840+
// namespace might be anonymous
841+
if(lex.LookAhead(0) != '{')
843842
{
844843
if(lex.get_token(tk2)==TOK_IDENTIFIER)
845844
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
@@ -153,7 +153,7 @@ void value_sett::output(
153153
result="<"+from_expr(ns, identifier, o)+", ";
154154

155155
if(o_it->second)
156-
result += integer2string(*o_it->second) + "";
156+
result += integer2string(*o_it->second);
157157
else
158158
result+='*';
159159

src/pointer-analysis/value_set_fi.cpp

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

105105
if(o_it->second)
106-
result += integer2string(*o_it->second) + "";
106+
result += integer2string(*o_it->second);
107107
else
108108
result+='*';
109109

src/pointer-analysis/value_set_fivr.cpp

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

146146
if(o_it->second)
147-
result += integer2string(*o_it->second) + "";
147+
result += integer2string(*o_it->second);
148148
else
149149
result+='*';
150150

src/pointer-analysis/value_set_fivrns.cpp

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

137137
if(o_it->second)
138-
result += integer2string(*o_it->second) + "";
138+
result += integer2string(*o_it->second);
139139
else
140140
result+='*';
141141

0 commit comments

Comments
 (0)