Skip to content

Commit 557b8cc

Browse files
committed
core: fix a typo in levdistance
1 parent 5f2d410 commit 557b8cc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ pub pure fn split_str_nonempty(s: &'a str, sep: &'b str) -> ~[~str] {
599599
pub fn levdistance(s: &str, t: &str) -> uint {
600600

601601
let slen = s.len();
602-
let tlen = s.len();
602+
let tlen = t.len();
603603

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

614-
for s.each_chari |j, tc| {
614+
for t.each_chari |j, tc| {
615615

616616
let mut next = dcol[j + 1];
617617

0 commit comments

Comments
 (0)