[rhmessaging-commits] rhmessaging commits: r1651 - store/trunk/cpp/tests/jrnl/jtt.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Feb 6 16:38:19 EST 2008


Author: kpvdr
Date: 2008-02-06 16:38:19 -0500 (Wed, 06 Feb 2008)
New Revision: 1651

Modified:
   store/trunk/cpp/tests/jrnl/jtt/read_arg.cpp
Log:
Fixed warning

Modified: store/trunk/cpp/tests/jrnl/jtt/read_arg.cpp
===================================================================
--- store/trunk/cpp/tests/jrnl/jtt/read_arg.cpp	2008-02-06 21:28:37 UTC (rev 1650)
+++ store/trunk/cpp/tests/jrnl/jtt/read_arg.cpp	2008-02-06 21:38:19 UTC (rev 1651)
@@ -62,12 +62,10 @@
 const std::string&
 read_arg::str(const read_mode_t rm)
 {
-    for (std::map<std::string, read_mode_t>::const_iterator i = _map.begin(); i != _map.end(); i++)
-    {
-        if (i->second == rm)
-            return i->first;
-    }
-    assert(!"map - enum mismatch");
+    std::map<std::string, read_mode_t>::const_iterator i = _map.begin();
+    while (i->second != rm && i != _map.end()) i++;
+    assert(i != _map.end());
+    return i->first;
 }
 
 // static fn




More information about the rhmessaging-commits mailing list