Skip to content

Commit 3705bb9

Browse files
committed
Simplified generateWindowName
I removed lines of code within cv::viz::VizStorage::generateWindowName in an attempt to have "Viz - " prepended to window name automatically.
1 parent 5fae408 commit 3705bb9

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

modules/viz/src/vizcore.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,13 @@ void cv::viz::VizStorage::removeUnreferenced()
138138

139139
cv::String cv::viz::VizStorage::generateWindowName(const String &window_name)
140140
{
141-
String output = "Viz";
142-
// Already is Viz
143-
if (window_name == output)
144-
return output;
141+
cv::String output = "Viz";
145142

146-
String prefixed = output + " - ";
143+
cv::String prefixed = output + " - ";
147144
if (window_name.substr(0, prefixed.length()) == prefixed)
148145
output = window_name; // Already has "Viz - "
149-
else if (window_name.substr(0, output.length()) == output)
150-
output = prefixed + window_name; // Doesn't have prefix
151146
else
152-
output = (window_name == "" ? output : prefixed + window_name);
147+
output = prefixed + window_name; // Doesn't have prefix
153148

154149
return output;
155150
}

0 commit comments

Comments
 (0)