On 20-Apr-15, Olaf Dabrunz wrote:
> A remaining problem is that the interdependence of the checks and
> preparations in set_var_lval() and tv_op() with checks in set_var()
> is implicit, and this makes this code more difficult to maintain. One
> could consider moving the tv_op() for setting plain variables into
> set_var(), but I have not looked into this sufficiently.
After thinking about this more, the presented patch seems to be a good
compromise:
- It keeps the current layering intact.
- The additional lock checks are not very time consuming, and they
need to be done there anyway, even if we streamlined
set_var_lval() and set_var() into a single function.
- Doing list extension in two steps, i.e. first copying and
extending the list and then assigning the copy, is much less
efficient.
- The 'list += list' case is the only case where the preparation in
tv_op() changes the variable. This case has been taken care of
with the patch, at least for now.
If needed, to ease maintenance, a comment could be added.
--
Olaf Dabrunz (oda <at> fctrace.org)
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.