From 0046dcdf1ad724f2b339d14691103aea2b648af5 Mon Sep 17 00:00:00 2001 From: lolmanurfunny <77128366+lolmanurfunny@users.noreply.github.com> Date: Fri, 28 Mar 2025 21:22:15 -0400 Subject: [PATCH 1/2] find_archetype_with shouldn't clone types unconditionally (#210) --- jecs.luau | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jecs.luau b/jecs.luau index 596293a..9fca297 100644 --- a/jecs.luau +++ b/jecs.luau @@ -737,13 +737,13 @@ local function find_archetype_with(world: ecs_world_t, node: ecs_archetype_t, id -- them each time would be expensive. Instead this insertion sort can find the insertion -- point in the types array. - local dst = table.clone(node.types) :: { i53 } local at = find_insert(id_types, id) if at == -1 then -- If it finds a duplicate, it just means it is the same archetype so it can return it -- directly instead of needing to hash types for a lookup to the archetype. return node end + local dst = table.clone(id_types) :: { i53 } table.insert(dst, at, id) return archetype_ensure(world, dst) From 27b58e97453f2fe939914a4c5d0f5b82c0e367a8 Mon Sep 17 00:00:00 2001 From: EncodedVenom <32179912+EncodedVenom@users.noreply.github.com> Date: Sun, 30 Mar 2025 12:24:24 -0400 Subject: [PATCH 2/2] Update jecs.md Makes the sentence clearer --- docs/api/jecs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/jecs.md b/docs/api/jecs.md index 75012f7..794239f 100644 --- a/docs/api/jecs.md +++ b/docs/api/jecs.md @@ -45,6 +45,6 @@ function jecs.pair( ``` ::: info -Note that while relationship pairs can be used as components, meaning you can add data with it as an ID, however they cannot be used as entities. Meaning you cannot add components to a pair as the source of a binding. +While relationship pairs can be used as components and have data associated with an ID, they cannot be used as entities. Meaning you cannot add components to a pair as the source of a binding. :::