Ignore:
Timestamp:
08/29/09 17:26:11 (5 years ago)
Author:
xi
Message:

Do not update the raw buffer when not necessary (fixes #123).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libyaml/branches/stable/src/reader.c

    r324 r352  
    142142yaml_parser_update_buffer(yaml_parser_t *parser, size_t length) 
    143143{ 
     144    int first = 1; 
     145 
    144146    assert(parser->read_handler);   /* Read handler must be set. */ 
    145147 
     
    179181    while (parser->unread < length) 
    180182    { 
    181         /* Fill the raw buffer. */ 
    182  
    183         if (!yaml_parser_update_raw_buffer(parser)) return 0; 
     183        /* Fill the raw buffer if necessary. */ 
     184 
     185        if (!first || parser->raw_buffer.pointer == parser->raw_buffer.last) { 
     186            if (!yaml_parser_update_raw_buffer(parser)) return 0; 
     187        } 
     188        first = 0; 
    184189 
    185190        /* Decode the raw buffer. */ 
Note: See TracChangeset for help on using the changeset viewer.