--- parser3/src/main/pa_table.C 2023/09/26 20:49:10 1.73 +++ parser3/src/main/pa_table.C 2024/11/16 02:57:05 1.78 @@ -1,13 +1,13 @@ /** @file Parser: table class. - Copyright (c) 2001-2023 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_table.h" -volatile const char * IDENT_PA_TABLE_C="$Id: pa_table.C,v 1.73 2023/09/26 20:49:10 moko Exp $" IDENT_PA_TABLE_H; +volatile const char * IDENT_PA_TABLE_C="$Id: pa_table.C,v 1.78 2024/11/16 02:57:05 moko Exp $" IDENT_PA_TABLE_H; #include "pa_exception.h" @@ -19,7 +19,7 @@ void Table::column_names_init(){ if(fcolumns){ name2number = new name2number_hash_class; size_t number=1; - for(Array_iterator i(*fcolumns); i.has_next(); ) { + for(ArrayString::Iterator i(*fcolumns); i; ) { const String& name=*i.next(); name2number->put(name, number++); } @@ -34,7 +34,7 @@ static void append_row(Table& src, Table } Table::Table(const Table& src, Action_options& options) : - Array( (options.limit==ARRAY_OPTION_LIMIT_ALL || options.limit>src.count()) ? src.count() : options.limit), + Array(options.limit > src.count() ? src.count() : options.limit), fcurrent(0), fcolumns(src.fcolumns), @@ -88,7 +88,7 @@ void Table::remove_current(){ throw Exception(PARSER_RUNTIME, 0, "invalid current row"); } remove(fcurrent); - if(fcurrent==count() && count()>0){ + if(fcurrent>=count() && count()>0){ fcurrent--; } }