Replies: 3 comments 3 replies
-
Question 2: There seems to be some array handling in internal structures eg_ I'm not 100% sure but for me it looks like, that there is some redundant code which can / should be removed. -- |
Beta Was this translation helpful? Give feedback.
-
You're correct. That comment was an attempt to unobfuscate how the LinkedList works before I did a refactor and encapsulated the managing of the list's ends with the LLMap type. I can make a PR to remove that comment.
It's been a while since I've dealt with the LinkedList, but prev.map can store arrays. Try this:
So it can have arrays, but only when duplicate values are involved. It might have made a cleaner implementation if I had it only store arrays, but that had lists with thousands of unique values storing thousands of arrays of length 1, which was a noticeable performance hit. And since big lists of unique values makes 95%+ of the use cases, I opted for that. I also opted for this strange system after first trying a traditional linked list (where each entry has a data object with its own Does this create a LinkedList that scales beautifully once thousands of entries are involved? Yes. |
Beta Was this translation helpful? Give feedback.
-
Why use var results = new $tw.utils.LinkedList(); instead of var results = []; I was always using array in my plugins, but I find core filters are using |
Beta Was this translation helpful? Give feedback.
-
This discussion is related to PR: #8213
@flibbles -- There have been some issues lately, where ListLinks throws an RSOD for incoming undefined values, because of 3rd-party JS bugs.
So I did have a closer look at the code. I do like the "debuggability" of used list-structure.
There are several points I do want to ask:
Question 1: https://github.com/flibbles/TiddlyWiki5/blob/master/editions/test/tiddlers/tests/test-linked-list.js the comment says
I think that's not true anymore. I'm not able to see an "undefined" value in the
prev
structure. I used this code:Can you check the test comments, if they are still true?
Beta Was this translation helpful? Give feedback.
All reactions