about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science/math/or-tools/fix-stringview-compile.patch
blob: 760ab80a38e4d2c47d82d1b78b705fea81647902 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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));
     }
   }