photopea / UPNG.js

Fast and advanced PNG (APNG) decoder and encoder (lossy / lossless)
MIT License
2.1k stars 259 forks source link

有段代码不是很理解,这是不是死循环,有别的写法吗 #63

Closed wangwei48 closed 3 years ago

wangwei48 commented 3 years ago

while (!0) { var T = v[e(N, d) & X]; d += T & 15; var p = T >>> 4; if (p >>> 8 === 0) { W[w++] = p; } else if (p === 256) { break; } else { var z = w + p - 254; if (p > 264) { var = b.q[p - 257]; z = w + ( >>> 3) + A(N, d, & 7); d += & 7; } var $ = C[e(N, d) & u]; d += $ & 15; var s = $ >>> 4; var Y = b.c[s]; var a = (Y >>> 4) + n(N, d, Y & 15); d += Y & 15; while (w < z) { W[w] = W[w++ - a]; W[w] = W[w++ - a]; W[w] = W[w++ - a]; W[w] = W[w++ - a]; } w = z; } }

photopea commented 3 years ago

Hi, I wrote it this way to make the code short. I think this part of code will never need any modifications from you or me. Nobody will ever need to know how this code works, because it will always work correctly.