Skip to content

Commit

Permalink
Merge pull request #1112 from joakim-hove/smspec-sort
Browse files Browse the repository at this point in the history
Sort SummaryConfig with smspec_node_cmp( ).
  • Loading branch information
joakim-hove authored Aug 11, 2017
2 parents 281bf9a + 1da8c7a commit 868e49b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/eclipse/EclipseState/SummaryConfig/SummaryConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>

#include <ert/ecl/Smspec.hpp>
#include <ert/ecl/ecl_smspec.h>

#include <iostream>
Expand Down Expand Up @@ -361,11 +362,12 @@ inline void handleKW( std::vector< ERT::smspec_node >& list,
inline void uniq( std::vector< ERT::smspec_node >& vec ) {
const auto lt = []( const ERT::smspec_node& lhs,
const ERT::smspec_node& rhs ) {
return std::strcmp( lhs.key1(), rhs.key1() ) < 0;
return ERT::smspec_node::cmp( lhs, rhs ) < 0;
};

const auto eq = []( const ERT::smspec_node& lhs,
const ERT::smspec_node& rhs ) {
return std::strcmp( lhs.key1(), rhs.key1() ) == 0;
return ERT::smspec_node::cmp( lhs, rhs ) == 0;
};

std::sort( vec.begin(), vec.end(), lt );
Expand Down

0 comments on commit 868e49b

Please sign in to comment.