|
From: <jfb...@us...> - 2009-03-05 21:12:09
|
Revision: 1000
http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1000&view=rev
Author: jfbastien
Date: 2009-03-05 21:12:02 +0000 (Thu, 05 Mar 2009)
Log Message:
-----------
Cache call to size() in find(): it wasn't being optimized out.
Modified Paths:
--------------
trunk/include/loki/flex/flex_string_shell.h
Modified: trunk/include/loki/flex/flex_string_shell.h
===================================================================
--- trunk/include/loki/flex/flex_string_shell.h 2009-03-05 21:09:20 UTC (rev 999)
+++ trunk/include/loki/flex/flex_string_shell.h 2009-03-05 21:12:02 UTC (rev 1000)
@@ -896,9 +896,10 @@
size_type find (const value_type* s, size_type pos, size_type n) const
{
- if (n + pos > size())
+ const size_type size(size());
+ if (n + pos > size)
return npos;
- for (; pos + n <= size(); ++pos)
+ for (; pos + n <= size; ++pos)
{
if (traits_type::compare(data() + pos, s, n) == 0)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|