From 114fb0958fc9544d9b5ff93013a0251bf3322aff Mon Sep 17 00:00:00 2001 From: w00t Date: Tue, 29 Nov 2005 02:08:53 +0000 Subject: strcmp() is a little expensive, and useless here -- ointers make our lives easier. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1986 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd_io.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index aa5d5af65..ac5f66821 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -184,11 +184,11 @@ std::string ConfProcess(char* buffer, long linenumber, std::stringstream* errors buffer[d] = ' '; while ((buffer[0] == ' ') && (strlen(buffer)>0)) buffer++; while ((buffer[strlen(buffer)-1] == ' ') && (strlen(buffer)>0)) buffer[strlen(buffer)-1] = '\0'; - // empty lines are syntactically valid - if (!strcmp(buffer,"")) - return ""; - else if (buffer[0] == '#') + + // empty lines are syntactically valid, as are comments + if (!(*buffer) || buffer[0] == '#') return ""; + for (unsigned int c = 0; c < strlen(buffer); c++) { // convert all spaces that are OUTSIDE quotes into hardspace (0xA0) as this will make them easier to -- cgit v1.2.3