Skip to content

Commit 6144f21

Browse files
committed
Revert unreadable '9e9' and 'if (x > max) max = x;' optimizations from srx/library_gl.js. Regresses hello webgl by 10 bytes (+0.17%)
1 parent f4efacc commit 6144f21

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/library_gl.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ var LibraryGL = {
252252
var source = '';
253253
for (var i = 0; i < count; ++i) {
254254
var len = length ? {{{ makeGetValue('length', 'i*4', 'i32') }}} : -1;
255-
source += UTF8ToString({{{ makeGetValue('string', 'i*4', 'i32') }}}, len < 0 ? 9e9/*short abbrv. for infinity*/ : len);
255+
source += UTF8ToString({{{ makeGetValue('string', 'i*4', 'i32') }}}, len < 0 ? undefined : len);
256256
}
257257
#if LEGACY_GL_EMULATION
258258
// Let's see if we need to enable the standard derivatives extension
@@ -968,10 +968,7 @@ var LibraryGL = {
968968
var u = GLctx.getActiveUniform(p, i);
969969

970970
var name = u.name;
971-
var length = name.length + 1;
972-
if (length > ptable.maxUniformLength) {
973-
ptable.maxUniformLength = length;
974-
}
971+
ptable.maxUniformLength = Math.max(ptable.maxUniformLength, name.length+1);
975972

976973
// Strip off any trailing array specifier we might have got, e.g. "[0]".
977974
var ls = name.lastIndexOf('[');

0 commit comments

Comments
 (0)