mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 20:47:46 +00:00
Merge pull request #6949 from alexs-sh/feature-seq-reduce-memory-allocation-during-prefix-search
seq:reduce memory allocation during prefix search
This commit is contained in:
commit
7025620639
1 changed files with 1 additions and 1 deletions
|
@ -341,7 +341,7 @@ impl FromStr for PreciseNumber {
|
|||
// Check if the string seems to be in hexadecimal format.
|
||||
//
|
||||
// May be 0x123 or -0x123, so the index `i` may be either 0 or 1.
|
||||
if let Some(i) = s.to_lowercase().find("0x") {
|
||||
if let Some(i) = s.find("0x").or_else(|| s.find("0X")) {
|
||||
if i <= 1 {
|
||||
return parse_hexadecimal(s);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue