diff options
Diffstat (limited to 'pkgs/development/libraries/science/math/or-tools/fix-stringview-compile.patch')
-rw-r--r-- | pkgs/development/libraries/science/math/or-tools/fix-stringview-compile.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/development/libraries/science/math/or-tools/fix-stringview-compile.patch b/pkgs/development/libraries/science/math/or-tools/fix-stringview-compile.patch new file mode 100644 index 00000000000..760ab80a38e --- /dev/null +++ b/pkgs/development/libraries/science/math/or-tools/fix-stringview-compile.patch @@ -0,0 +1,36 @@ +diff --git a/ortools/lp_data/lp_parser.cc b/ortools/lp_data/lp_parser.cc +index 58286306e5..bd26c019ab 100644 +--- a/ortools/lp_data/lp_parser.cc ++++ b/ortools/lp_data/lp_parser.cc +@@ -185,7 +185,7 @@ bool LPParser::ParseIntegerVariablesList(StringPiece line) { + + bool LPParser::ParseConstraint(StringPiece constraint) { + const StatusOr<ParsedConstraint> parsed_constraint_or_status = +- ::operations_research::glop::ParseConstraint(constraint.as_string()); ++ ::operations_research::glop::ParseConstraint(constraint); + if (!parsed_constraint_or_status.ok()) return false; + const ParsedConstraint& parsed_constraint = + parsed_constraint_or_status.value(); +@@ -342,10 +342,9 @@ TokenType LPParser::ConsumeToken(StringPiece* sp) { + + } // namespace + +-StatusOr<ParsedConstraint> ParseConstraint(absl::string_view constraint_view) { ++StatusOr<ParsedConstraint> ParseConstraint(absl::string_view constraint) { + ParsedConstraint parsed_constraint; + // Get the name, if present. +- StringPiece constraint{constraint_view}; + StringPiece constraint_copy{constraint}; + std::string consumed_name; + Fractional consumed_coeff; +@@ -413,8 +412,8 @@ StatusOr<ParsedConstraint> ParseConstraint(absl::string_view constraint_view) { + right_bound = consumed_coeff; + if (ConsumeToken(&constraint, &consumed_name, &consumed_coeff) != + TokenType::END) { +- return absl::InvalidArgumentError(absl::StrCat( +- "End of input was expected, found: ", constraint.as_string())); ++ return absl::InvalidArgumentError( ++ absl::StrCat("End of input was expected, found: ", constraint)); + } + } + |