Skip to content

Commit

Permalink
Remove unused variable from endswith (#56934)
Browse files Browse the repository at this point in the history
This is a trivial code cleanup suggestion. The `cub` variable was unused
in `endswith(::Union{String, SubString{String}}, ::Union{String,
SubString{String}})`.

I ran the tests with `make test`, there were some failures but they did
not appear to be related to the change.
  • Loading branch information
llbit authored Jan 2, 2025
1 parent 27b44cf commit a393c6f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion base/strings/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ Base.startswith(io::IO, prefix::AbstractString) = startswith(io, String(prefix))

function endswith(a::Union{String, SubString{String}},
b::Union{String, SubString{String}})
cub = ncodeunits(b)
astart = ncodeunits(a) - ncodeunits(b) + 1
if astart < 1
false
Expand Down

0 comments on commit a393c6f

Please sign in to comment.