Skip to content

Commit

Permalink
Update mpint_field and arg_kv (#175)
Browse files Browse the repository at this point in the history
* Update mpint_field.cc

* Update arg_kv.h

* Update arg_kv.h

* Update arg_kv.cc

* Update arg_kv.h
  • Loading branch information
maths644311798 authored Dec 20, 2023
1 parent 2b7d888 commit 0610185
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion yacl/math/galois_field/mpint_field/mpint_field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void MPIntField::NegInplace(MPInt *x) const {
WEAK_ENFORCE(IsInField(*x), "x is not a valid field element, x={}", *x);
x->NegateInplace();
AddInplace(x, mod_);
x->DecrOne();
}

MPInt MPIntField::Inv(const MPInt &x) const { return x.InvertMod(mod_); }
Expand Down
4 changes: 2 additions & 2 deletions yacl/utils/spi/argument/arg_kv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const std::string& SpiArg::Key() const { return key_; }

bool SpiArg::HasValue() const { return value_.has_value(); }

SpiArg SpiArg::operator=(const char* value) {
SpiArg& SpiArg::operator=(const char* value) {
value_ = absl::AsciiStrToLower(std::string(value));
return *this;
}

SpiArg SpiArg::operator=(const std::string& value) {
SpiArg& SpiArg::operator=(const std::string& value) {
value_ = absl::AsciiStrToLower(value);
return *this;
}
Expand Down
6 changes: 3 additions & 3 deletions yacl/utils/spi/argument/arg_kv.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ class SpiArg {
}

template <typename T>
SpiArg operator=(const T &value) {
SpiArg &operator=(const T &value) {
value_ = value;
return *this;
}

// Specialized functions of operator=<T>
SpiArg operator=(const char *value);
SpiArg operator=(const std::string &value);
SpiArg &operator=(const char *value);
SpiArg &operator=(const std::string &value);

const std::string &Key() const;
bool HasValue() const;
Expand Down

0 comments on commit 0610185

Please sign in to comment.