Skip to content

Commit

Permalink
style: refact rmv unnecessary PERCENTAGE token check
Browse files Browse the repository at this point in the history
  • Loading branch information
pauloamed committed Sep 16, 2024
1 parent 86b4fdc commit 53c5ac1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/web/vaev-style/values.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,12 +713,8 @@ Res<Percent> ValueParser<Percent>::parse(Cursor<Css::Sst> &c) {

if (c.peek() == Css::Token::PERCENTAGE) {
Io::SScan scan = c->token.data;
auto value = Io::atof(scan).unwrapOr(0.0);
if (scan.remStr() != "%")
return Error::invalidData("invalid percentage");

c.next();
return Ok(Percent{value});
return Ok(Percent{Io::atof(scan).unwrapOr(0.0)});
}

return Error::invalidData("expected percentage");
Expand Down

0 comments on commit 53c5ac1

Please sign in to comment.