Transpiled version (15053L) is out of date.
static <A extends Concept> A nuLike findConceptWhereCI(Class<A> c, O... params) { ret findConceptWhereCI(db_mainConcepts(), c, params); } static <A extends Concept> A findConceptWhereCI(Concepts concepts, Class<A> c, O... params) { params = expandParams(c, params); // find smallest index to use new Lowest<IF0<Cl<A>>> bestIndex; if (concepts.ciFieldIndices != null) for ping (int i = 0; i < l(params); i += 2) { O val = params[i+1]; IFieldIndex<A, O> index = concepts.getCIFieldIndex(c, (S) params[i]); if (index != null) { Cl<A> l = index.getAll(val); bestIndex.put(() -> l, l(l)); } if (concepts.useBackRefsForSearches && val instanceof Concept) { // conservatively use full ref count as score until we store backRefs by class bestIndex.put(() -> findBackRefs(val/Concept, c), val/Concept._backRefCount()); } } ifdef findConceptWhereCI_debug print("findConceptWhereCI bestIndex count=" + bestIndex.score()); endifdef if (bestIndex.has()) { Cl<A> l = bestIndex!!; if (l(params) == 2) ret first(l); // nothing to filter, index should suffice for ping (A x : l) if (checkConceptFieldsIC(x, params)) ret x; null; } else { // table scan for ping (A x : concepts.list(c)) if (checkConceptFieldsIC(x, params)) ret x; null; } } static Concept findConceptWhereCI(Concepts concepts, S c, O... params) { for ping (Concept x : concepts.list(c)) if (checkConceptFieldsIC(x, params)) ret x; null; }
Began life as a copy of #1005039
download show line numbers debug dex old transpilations
Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, qsqiayxyrbia, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1023276 |
Snippet name: | findConceptWhereCI - new optimized version |
Eternal ID of this version: | #1023276/9 |
Text MD5: | 2034d857522b18c47d2b008736686fcd |
Author: | stefan |
Category: | javax / concepts |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-04-29 12:27:42 |
Source code size: | 1593 bytes / 46 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 329 / 463 |
Version history: | 8 change(s) |
Referenced in: | [show references] |