/**
 * @author mrdoob / http://mrdoob.com/
 */

function WebGLObjects( gl, geometries, attributes, info ) {

	var updateList = {};

	function update( object ) {

		var frame = info.render.frame;

		var geometry = object.geometry;
		var buffergeometry = geometries.get( object, geometry );

		// Update once per frame

		if ( updateList[ buffergeometry.id ] !== frame ) {

			if ( geometry.isGeometry ) {

				buffergeometry.updateFromObject( object );

			}

			geometries.update( buffergeometry );

			updateList[ buffergeometry.id ] = frame;

		}

		if ( object.isInstancedMesh ) {

			attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );

		}

		return buffergeometry;

	}

	function dispose() {

		updateList = {};

	}

	return {

		update: update,
		dispose: dispose

	};

}


export { WebGLObjects };

@@ -109,33 +109,43 @@
 %0A%09var update
-List = %7B%7D
+Map = new WeakMap()
 ;%0A%0A%09function
@@ -330,29 +330,32 @@
 %09if ( update
-List%5B
+Map.get(
  buffergeome
@@ -357,21 +357,18 @@
 geometry
-.id %5D
+ )
  !== fra
@@ -516,13 +516,16 @@
 date
-List%5B
+Map.set(
  buf
@@ -539,21 +539,17 @@
 etry
-.id %5D =
+,
  frame
+ )
 ;%0A%0A%09
@@ -722,17 +722,19 @@
 date
-List = %7B%7D
+Map.clear()
 ;%0A%0A%09

change WebGLObjects.updateList to weakmap