@cryptotaxi247 / netdata-1 / commits / c3636a18f

remove useless optimization

Costa Tsaousis (ktsaou) committed Feb 17, 2018 at 22:26 UTC c3636a18fd3582e135ad110888fed2d685c5ca59
1 file changed +2 -16
src/procfile.c
+2 -16
@@ -139,24 +139,12 @@ void procfile_close(procfile *ff) {
139 freez(ff);
140 }
141
142 -__attribute__((noinline))
142 static void _procfile_parser_add_word(procfile *ff, size_t line, char *begin, char *end) {
143 *end = '\0';
144 ff->words = pfwords_add(ff->words, begin);
145 ff->lines->lines[line].words++;
146 }
147
149 -__attribute__((noinline))
150 -static char *_procfile_parser_skip_word(char *begin, char *end, PF_CHAR_TYPE *ct, PF_CHAR_TYPE *separators) {
151 - PF_CHAR_TYPE c = PF_CHAR_IS_NEWLINE;
152 -
153 - while(begin < end && (c = separators[(unsigned char)(*begin)]) == PF_CHAR_IS_WORD)
154 - begin++;
155 -
156 - *ct = c;
157 - return begin;
158 -}
159 -
148 static void procfile_parser(procfile *ff) {
149 // debug(D_PROCFILE, PF_PREFIX ": Parsing file '%s'", ff->filename);
150
@@ -174,12 +162,10 @@ static void procfile_parser(procfile *ff) {
162 , w = 0 // counts the number of words we added
163 , opened = 0; // counts the number of open parenthesis
164
177 - PF_CHAR_TYPE ct;
178 -
165 ff->lines = pflines_add(ff->lines, w);
166
181 - while((s = _procfile_parser_skip_word(s, e, &ct, separators)) < e) {
182 - // we are not at the end
167 + while(s < e) {
168 + PF_CHAR_TYPE ct = separators[(unsigned char)(*s)];
169
170 // this is faster than a switch()
171 if(likely(ct == PF_CHAR_IS_WORD)) {