From 327424d60819e790dff78bff309e97ec08dcccd8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 15 Jan 2014 21:24:28 +0100 Subject: port to std::algorithm Change-Id: I537b9ffc3eed0891bed0fcae3e0d79d70cc46cec Reviewed-by: Thiago Macieira --- util/qlalr/compress.cpp | 2 +- util/qlalr/lalr.cpp | 8 ++++---- util/qlalr/lalr.h | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/util/qlalr/compress.cpp b/util/qlalr/compress.cpp index aefcb03cd6..4ae0716047 100644 --- a/util/qlalr/compress.cpp +++ b/util/qlalr/compress.cpp @@ -174,7 +174,7 @@ void Compress::operator () (int *table, int row_count, int column_count) sortedTable [i].assign (i, begin, end); } - qSort (sortedTable.begin (), sortedTable.end (), _SortUncompressedRow ()); + std::sort (sortedTable.begin (), sortedTable.end (), _SortUncompressedRow ()); #ifndef QLALR_NO_CHECK_SORTED_TABLE int previous_zeros = INT_MAX; diff --git a/util/qlalr/lalr.cpp b/util/qlalr/lalr.cpp index 7377bf6321..c68076477f 100644 --- a/util/qlalr/lalr.cpp +++ b/util/qlalr/lalr.cpp @@ -166,7 +166,7 @@ State::State (Grammar *g): QPair State::insert (const Item &item) { - ItemPointer it = qFind (kernel.begin (), kernel.end (), item); + ItemPointer it = std::find (kernel.begin (), kernel.end (), item); if (it != kernel.end ()) return qMakePair (it, false); @@ -176,7 +176,7 @@ QPair State::insert (const Item &item) QPair State::insertClosure (const Item &item) { - ItemPointer it = qFind (closure.begin (), closure.end (), item); + ItemPointer it = std::find (closure.begin (), closure.end (), item); if (it != closure.end ()) return qMakePair (it, false); @@ -207,7 +207,7 @@ Grammar::Grammar (): Name Grammar::intern (const QString &id) { - Name name = qFind (names.begin (), names.end (), id); + Name name = std::find (names.begin (), names.end (), id); if (name == names.end ()) name = names.insert (names.end (), id); @@ -322,7 +322,7 @@ void Automaton::buildNullables () QPair Automaton::internState (const State &state) { - StatePointer it = qFind (states.begin (), states.end (), state); + StatePointer it = std::find (states.begin (), states.end (), state); if (it != states.end ()) return qMakePair (it, false); diff --git a/util/qlalr/lalr.h b/util/qlalr/lalr.h index 7f62b411ca..85c5b51e38 100644 --- a/util/qlalr/lalr.h +++ b/util/qlalr/lalr.h @@ -50,6 +50,7 @@ #include #include +#include #include class Rule; @@ -319,7 +320,7 @@ typename Node<_Tp>::iterator Node<_Tp>::get (_Tp data) template QPair::iterator>::iterator, bool> Node<_Tp>::insertEdge (typename Node<_Tp>::iterator other) const { - edge_iterator it = qFind (outs.begin (), outs.end (), other); + edge_iterator it = std::find (outs.begin (), outs.end (), other); if (it != outs.end ()) return qMakePair (it, false); -- cgit v1.2.1