Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Fix a typo in str::levdistance #5471

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libcore/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ pub pure fn split_str_nonempty(s: &'a str, sep: &'b str) -> ~[~str] {
pub fn levdistance(s: &str, t: &str) -> uint {

let slen = s.len();
let tlen = s.len();
let tlen = t.len();

if slen == 0 { return tlen; }
if tlen == 0 { return slen; }
Expand All @@ -611,7 +611,7 @@ pub fn levdistance(s: &str, t: &str) -> uint {
let mut current = i;
dcol[0] = current + 1;

for s.each_chari |j, tc| {
for t.each_chari |j, tc| {

let mut next = dcol[j + 1];

Expand Down