diff options
Diffstat (limited to 'src/tools/qlalr/compress.cpp')
-rw-r--r-- | src/tools/qlalr/compress.cpp | 39 |
1 files changed, 7 insertions, 32 deletions
diff --git a/src/tools/qlalr/compress.cpp b/src/tools/qlalr/compress.cpp index 18f9fb4b58..6ee083f7e9 100644 --- a/src/tools/qlalr/compress.cpp +++ b/src/tools/qlalr/compress.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "compress.h" @@ -164,7 +139,7 @@ void Compress::operator () (int *table, int row_count, int column_count) #ifndef QLALR_NO_CHECK_SORTED_TABLE int previous_zeros = INT_MAX; - for (const UncompressedRow &row : qAsConst(sortedTable)) + for (const UncompressedRow &row : std::as_const(sortedTable)) { int zeros = row.count (0); @@ -176,7 +151,7 @@ void Compress::operator () (int *table, int row_count, int column_count) index.fill (-999999, row_count); - for (const UncompressedRow &row : qAsConst(sortedTable)) + for (const UncompressedRow &row : std::as_const(sortedTable)) { int first_token = std::distance (row.begin (), row.beginNonZeros ()); QList<int>::iterator pos = info.begin(); @@ -186,7 +161,7 @@ void Compress::operator () (int *table, int row_count, int column_count) if (pos == info.begin ()) { // try to find a perfect match - QList<int>::iterator pm = std::search(&*pos, &*info.end(), row.beginNonZeros(), + QList<int>::iterator pm = std::search(pos, info.end(), row.beginNonZeros(), row.endNonZeros(), _PerfectMatch()); if (pm != info.end ()) @@ -196,7 +171,7 @@ void Compress::operator () (int *table, int row_count, int column_count) } } - pos = std::search (&*pos, &*info.end (), row.beginNonZeros (), row.endNonZeros (), _Fit ()); + pos = std::search (pos, info.end (), row.beginNonZeros (), row.endNonZeros (), _Fit ()); if (pos == info.end ()) break; @@ -251,7 +226,7 @@ void Compress::operator () (int *table, int row_count, int column_count) } #if 0 - for (const UncompressedRow &row : qAsConst(sortedTable)) + for (const UncompressedRow &row : std::as_const(sortedTable)) { int i = row.index (); Q_ASSERT (i < sortedTable.size ()); |