Skip to content

Commit

Permalink
Replace regex_split with MDAL::split in mdal_mike21.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
aka863 committed Jan 8, 2025
1 parent de67dc5 commit 3efa57f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions mdal/frmts/mdal_mike21.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@

#define DRIVER_NAME "Mike21"

// function to split using regex, by default split on whitespace characters
std::vector<std::string> regex_split( const std::string &input, const std::regex &split_regex = std::regex{"\\s+"} )
{
std::sregex_token_iterator iter( input.begin(), input.end(), split_regex, -1 );
std::sregex_token_iterator end;
return {iter, end};
}

static bool parse_vertex_id_gaps( std::map<size_t, size_t> &vertexIDtoIndex, size_t vertexIndex, size_t vertexID )
{
Expand Down Expand Up @@ -246,7 +239,7 @@ std::unique_ptr<MDAL::Mesh> MDAL::DriverMike21::load( const std::string &meshFil
{
if ( 0 < lineNumber && lineNumber < mVertexCount + 1 )
{
chunks = regex_split( MDAL::trim( line ) );
chunks = MDAL::split( MDAL::trim( line ),' ');
if ( chunks.size() != 5 )
{
MDAL::Log::error( MDAL_Status::Err_InvalidData, name(), "vertex line in invalid format." );
Expand Down Expand Up @@ -283,7 +276,7 @@ std::unique_ptr<MDAL::Mesh> MDAL::DriverMike21::load( const std::string &meshFil

if ( mVertexCount + 1 < lineNumber )
{
chunks = regex_split( MDAL::trim( line ) );
chunks = MDAL::split( MDAL::trim( line ),' ');
assert( faceIndex < faceCount );

size_t faceVertexCount = chunks.size() - 1;
Expand Down

0 comments on commit 3efa57f

Please sign in to comment.