comparison libinterp/corefcn/ls-oct-text.h @ 21021:a5b99b09f8fd

maint: Use comparison operators rather than compare() for strings. * graphics.cc, graphics.in.h, load-path.cc, ls-oct-text.cc, ls-oct-text.h, __init_fltk__.cc, oct-parse.in.yy, file-ops.cc: Use comparison operators rather than compare() for strings.
author Rik <rik@octave.org>
date Thu, 31 Dec 2015 13:39:25 -0800
parents f7084eae3318
children 538b57866b90
comparison
equal deleted inserted replaced
21020:7ebc9f38b312 21021:a5b99b09f8fd
91 91
92 while (is.get (c) && isalpha (c)) 92 while (is.get (c) && isalpha (c))
93 buf << c; 93 buf << c;
94 94
95 std::string tmp = buf.str (); 95 std::string tmp = buf.str ();
96 bool match = (tmp.compare (0, strlen (keyword), keyword) == 0); 96 bool match = (tmp.substr (0, strlen (keyword)) == keyword);
97 97
98 if (match) 98 if (match)
99 { 99 {
100 while (is.get (c) && (c == ' ' || c == '\t' || c == ':')) 100 while (is.get (c) && (c == ' ' || c == '\t' || c == ':'))
101 ; // Skip whitespace and the colon. 101 ; // Skip whitespace and the colon.