Commit 9c2a4ed0c4b72946e615345bee17f015bb1bc26e

  • avatar
  • Flavio Castelli <fcastelli @nov…ll.com>
  • Mon Sep 06 18:50:39 CEST 2010
50% performance improvement while parsing numbers.
See bug http://goo.gl/lSRQ for details.
  
278278 }
279279 }
280280 else if (isdigit(ch) != 0 && m_quotmarkClosed) {
281 *yylval = QVariant(QString::fromLatin1(QByteArray(&ch,1)));
281 qint64 number = atoll(&ch);
282 char nextCh;
283 qint64 ret = m_io->peek(&nextCh, 1);
284 while (ret == 1 && isdigit(nextCh)) {
285 m_io->read(1); //consume
286 yylloc->columns(1);
287 number = number *10 + atoll(&nextCh);
288 ret = m_io->peek(&nextCh, 1);
289 }
290
291 *yylval = QVariant(number);
282292 qjsonDebug() << "JSonScanner::yylex - yy::json_parser::token::DIGIT";
283293 return yy::json_parser::token::DIGIT;
284294 }