mirror of
				https://github.com/Ukendio/jecs.git
				synced 2025-10-29 16:39:17 +00:00 
			
		
		
		
	Reduce indexing
This commit is contained in:
		
							parent
							
								
									87e986b6aa
								
							
						
					
					
						commit
						ff54fb3d62
					
				
					 1 changed files with 6 additions and 3 deletions
				
			
		|  | @ -743,6 +743,8 @@ do | |||
|     local compatible_archetypes: { Archetype } | ||||
|     local column_indices: { { number} } | ||||
|     local ids: { number } | ||||
|     local tr | ||||
|     local columns | ||||
| 
 | ||||
|     local function world_query_next(): any | ||||
|         local entityId = entities[i] | ||||
|  | @ -752,6 +754,8 @@ do | |||
|  			if not archetype then | ||||
|                 return nil | ||||
|             end | ||||
|             tr = column_indices[lastArchetype] | ||||
|             columns = archetype.columns | ||||
|             entities = archetype.entities | ||||
|  			i = #entities | ||||
|  			entityId = entities[i] | ||||
|  | @ -760,9 +764,6 @@ do | |||
|   		local row = i | ||||
|   		i-=1 | ||||
| 
 | ||||
|   		local columns = archetype.columns | ||||
|   		local tr = column_indices[lastArchetype] | ||||
| 
 | ||||
|   		if queryLength == 1 then | ||||
|  			return entityId, columns[tr[1]][row] | ||||
|   		elseif queryLength == 2 then | ||||
|  | @ -1012,6 +1013,8 @@ do | |||
| 
 | ||||
|         entities = archetype.entities | ||||
|        	i = #entities | ||||
|         tr = column_indices[lastArchetype] | ||||
|         columns = archetype.columns | ||||
| 
 | ||||
|        	return it | ||||
|     end | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue