Skip to content

Commit fc88c71

Browse files
committed
COMP: Remove unused calls in itkHashTableTest
To address: D:\a\1\s\Modules\Core\Common\test\itkHashTableTest.cxx(82): warning C4834: discarding return value of function with 'nodiscard' attribute The return values of these calls are not checked. This is less important now that we are using a C++ STL data structure for the hash table instead of our own implementation.
1 parent 8cd2bd6 commit fc88c71

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

Modules/Core/Common/test/itkHashTableTest.cxx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,12 @@ itkHashTableTest(int, char *[])
7979
lookup(Set, "apple");
8080
lookup(Set, "durian");
8181

82-
Set.begin();
83-
Set.end();
84-
Set.size();
85-
Set.max_size();
8682
// CppCheck gives us a warning if the return value isn't used.
8783
// This is to prevent the user from calling empty() when they mean clear().
8884
if (Set.empty())
8985
std::cout << "Set is empty." << std::endl;
90-
Set.bucket_count();
9186
Set.rehash(50);
9287
Set.insert("the horror");
93-
Set.count("apple");
94-
Set.find("kiwi");
9588
auto hsh_it = Set.begin();
9689
HashSetType::const_iterator hst_const_it;
9790
hst_const_it = Set.end();
@@ -120,20 +113,13 @@ itkHashTableTest(int, char *[])
120113
std::cout << "june -> " << months["june"] << std::endl;
121114
std::cout << "november -> " << months["november"] << std::endl;
122115

123-
months.begin();
124-
months.end();
125-
months.size();
126-
months.max_size();
127116
// CppCheck gives us a warning if the return value isn't used.
128117
// This is to prevent the user from calling empty() when they mean clear().
129118
if (months.empty())
130119
std::cout << "Set is empty." << std::endl;
131-
months.bucket_count();
132120
months.rehash(50);
133121
HashMapType::value_type p("psychotic break", 2);
134122
months.insert(p);
135-
months.count("january");
136-
months.find("june");
137123
auto map_it = months.begin();
138124
HashMapType::const_iterator map_const_it;
139125
map_const_it = months.end();

0 commit comments

Comments
 (0)