[vlc-devel] [PATCH] lua/intf/cli: fix invalid concatenation of empty string
filip at atch.se
Wed Oct 26 15:22:13 CEST 2016
On 2016-10-26 15:17, Pierre Ynard wrote:
> > - local str = "| "..prefix..tostring(item.id).." - "..item.name
> > + local str = "| "..prefix..tostring(item.id)..
> > + (item.name == nil and "" or " - "..item.name)
> In lua, only nil and false evaluate to false in boolean context, so I
> think the "== nil" is redundant.
Indeed, but I reasoned that including the `== nil` was making the
code easier to comprehend.
> Also, I don't find this very helpful as you end up with a blank entry,
> that possibly won't play correctly, with no obvious way to query info
> about it. Perhaps it would be more helpful to display something else
> instead if the name is missing.
The entry still has the numeric identifier, which is unconditionally
displayed, so you would still be able to query information about the
entity (in case that is wanted).
I do not understand what you mean by *"that possibly won't play
correctly"*, the "name" property of an item is not mandatory - and
will not aid when an item is actually scheduled to be played.
- could you please elaborate that point?
> Pierre Ynard
> "Une âme dans un corps, c'est comme un dessin sur une feuille de papier."
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vlc-devel