Database: Remove Database::allLines()

The Database class itself can now be used in range-based for loops for iterating
over all the lines.
This commit is contained in:
Shaun Ruffell 2019-12-23 04:36:39 -06:00 committed by lauft
parent bd1f7aef99
commit 623db0c8e4
3 changed files with 1 additions and 22 deletions

View file

@ -264,26 +264,6 @@ std::string Database::lastLine ()
return "";
}
////////////////////////////////////////////////////////////////////////////////
std::vector <std::string> Database::allLines ()
{
if (_files.empty ())
{
initializeDatafiles ();
}
std::vector <std::string> all;
for (auto& file : _files)
{
auto i = file.allLines ();
all.insert (all.end (),
std::make_move_iterator (i.begin ()),
std::make_move_iterator (i.end ()));
}
return all;
}
////////////////////////////////////////////////////////////////////////////////
void Database::addInterval (const Interval& interval, bool verbose)
{

View file

@ -99,7 +99,6 @@ public:
std::vector <std::string> files () const;
std::string lastLine ();
std::vector <std::string> allLines ();
void addInterval (const Interval&, bool verbose);
void deleteInterval (const Interval&);

View file

@ -315,7 +315,7 @@ std::vector <Range> getAllExclusions (
std::vector <Interval> getAllInclusions (Database& database)
{
std::vector <Interval> all;
for (auto& line : database.allLines ())
for (auto& line : database)
{
Interval i = IntervalFactory::fromSerialization (line);
all.push_back (i);