Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 70576 invoked from network); 16 Jul 2007 13:01:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Jul 2007 13:01:25 -0000 Received: (qmail 26840 invoked by uid 500); 16 Jul 2007 13:01:27 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 26810 invoked by uid 500); 16 Jul 2007 13:01:27 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 26801 invoked by uid 99); 16 Jul 2007 13:01:27 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2007 06:01:27 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Jul 2007 06:01:24 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id DBC431A981A; Mon, 16 Jul 2007 06:01:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r556612 - /activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp Date: Mon, 16 Jul 2007 13:01:03 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070716130103.DBC431A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Jul 16 06:01:02 2007 New Revision: 556612 URL: http://svn.apache.org/viewvc?view=rev&rev=556612 Log: Code Cleanup Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp?view=diff&rev=556612&r1=556611&r2=556612 ============================================================================== --- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp (original) +++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/StringTokenizer.cpp Mon Jul 16 06:01:02 2007 @@ -25,8 +25,7 @@ //////////////////////////////////////////////////////////////////////////////// StringTokenizer::StringTokenizer( const std::string& str, const std::string& delim, - bool returnDelims ) -{ + bool returnDelims ) { // store off the data this->str = str; this->delim = delim; @@ -45,9 +44,9 @@ { int count = 0; string::size_type localPos = pos; - string::size_type lastPos = pos; + string::size_type lastPos = pos; - while(localPos != string::npos) { + while( localPos != string::npos ) { if( returnDelims && str.find_first_of( delim, localPos ) == localPos ) { count += 1; @@ -58,10 +57,10 @@ // Find first token by spanning the fist non-delimiter, to the // next delimiter, skipping any delimiters that are at the curret // location. - lastPos = str.find_first_not_of(delim, localPos); - localPos = str.find_first_of(delim, lastPos); + lastPos = str.find_first_not_of( delim, localPos ); + localPos = str.find_first_of( delim, lastPos ); - if(lastPos != string::npos) { + if( lastPos != string::npos ) { count++; } } @@ -73,8 +72,8 @@ bool StringTokenizer::hasMoreTokens() const { string::size_type nextpos = - returnDelims ? str.find_first_of(delim, pos) : - str.find_first_not_of(delim, pos); + returnDelims ? str.find_first_of( delim, pos ) : + str.find_first_not_of( delim, pos ); return ( nextpos != string::npos ); } @@ -84,7 +83,6 @@ throw ( lang::exceptions::NoSuchElementException ) { if( pos == string::npos ) { - throw NoSuchElementException( __FILE__, __LINE__, "StringTokenizer::nextToken - No more Tokens available");