From 4c0efd3d1a29ed2434d137c0cf7d913a0aba2050 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Fri, 30 Jul 2004 07:46:11 +0000 Subject: [PATCH] Small optimization of equal() functions. [SVN r24185] --- include/boost/algorithm/string/find_iterator.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/boost/algorithm/string/find_iterator.hpp b/include/boost/algorithm/string/find_iterator.hpp index a660b9b..26d08b6 100644 --- a/include/boost/algorithm/string/find_iterator.hpp +++ b/include/boost/algorithm/string/find_iterator.hpp @@ -136,7 +136,10 @@ namespace boost { // comparison bool equal( const find_iterator& Other ) const { - return eof() || Other.eof() ? eof() == Other.eof() : + bool bEof=eof(); + bool bOtherEof=Other.eof(); + + return bEof || bOtherEof ? bEof==bOtherEof : ( m_Match==Other.m_Match && m_End==Other.m_End @@ -297,7 +300,10 @@ namespace boost { // comparison bool equal( const split_iterator& Other ) const { - return eof() || Other.eof() ? eof() == Other.eof() : + bool bEof=eof(); + bool bOtherEof=Other.eof(); + + return bEof || bOtherEof ? bEof==bOtherEof : ( m_Match==Other.m_Match && m_Next==Other.m_Next &&