Good catch. vs autocomplete
The rest of your suggestion is sound advice. What I accidentally found out, while proving your suggestion was that vla-get-isxref provides a considerable time savings, as it filters out blocks defs that are not xref's at all.
- Elapsed milliseconds / relative speed for 512 iteration(s): (CD:XREFTEST1 XREFLIST)......13634 / 19.58 (CD:XREFTEST2 XREFLIST).....266996 / 1.00
The above xreflist is a 1432 length vla-object collection of vla-get-blocks. 383 are actuall xref's and 9 are direct xref's.
Both functions use your suggested method of combining the cd : block-isxref and cd : xref-status into a single function. I left the determination of whether to detach to lisp.
So the difference in the above function tests are that cd : xreftest1 included a pre-test for vla-get-isxref, while cd : xreftest2 sent every block def to be tested in .net.
After reminiscing. I believe I will still keep it seperate. Each Lisp Function I've created has a specific role; that thought actually did go into creating the functions, as my intention was to expand lisp in the spirit of lisp. Where logic is kept in lisp, and the lispfunctions provide expanded capability.
For instance. It could be thought that having a function to return boolean for IsUnloaded, is IsResolved, and IsFromExternalReference, might be condiered obsolete if I just returned the string for XrefStatus, however I can envision scenarios where each would serve purpose in the situation needed.
I just realized I took this thread over. I'm gratefull I stumbled on your original post, because I'd be further behind the curve than I already am.
Sincerely,