以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- safeEqval (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=184396) |
-- 作者:listfor -- 发布时间:2022/12/5 16:06:00 -- safeEqval def safeEqual(a: String, b: String) = { if (a.length != b.length) { false } else { var equal = 0 for (i <- Array.range(0, a.length)) { equal |= a(i) ^ b(i) } equal == 0 } }
|