ralph-irving / squeezeplay

Squeezeplay software player for Lyrion Music Server.
https://sourceforge.net/projects/lmsclients/files/squeezeplay/
50 stars 14 forks source link

Odd usage of != instead of ~= here #17

Closed stripwax closed 5 months ago

stripwax commented 11 months ago

https://github.com/ralph-irving/squeezeplay/blob/b4da1ca7d4e4f28e8a88aa59cc2be88362c22b3f/src/squeezeplay/share/applets/NowPlaying/NowPlayingApplet.lua#L1149

This seems subtly wrong with the usage of != instead of ~= here.

ralph-irving commented 10 months ago

That line hasn't been changed since June 2008 https://github.com/Logitech/squeezeplay/commit/a33ad060b78053fc4bfc193ced7d4e9ab6385d23#diff-e62d9558062532bf67dde779d7047bc855a1124df63fb779c18efb2a1e477314L390 and even then that part of the code was not modified. That doesn't mean it's correct however perhaps you can expand on your comment and provide an example using the lua provided in the squeezeplay build as that version has several language changes that are not part of the standard lua 5.1 syntax.

Also see https://github.com/Logitech/squeezeplay/blob/49f41e48311ade3a4a879b4b27283036363724b5/src/lua-5.1.1/src/luaconf.h#L240

stripwax commented 10 months ago

Yeah, fair point. I spotted this when I created the other issue ticket. Within NowPlayingApplet.lua, this is the only occurrence of != , whereas all other "not equal" occurrences are written as ~=

Functionally identical, as far as I know, so not a bug. Hence I wrote "odd usage" just because it seemed inconsistent, unless maybe I'm missing something and the usage of != here is intended to convey something else that ~= cannot convey.

of@openframe:/opt/squeezeplay$ grep '~=' share/jive/applets/NowPlaying/NowPlayingApplet.lua  | wc -l
25
of@openframe:/opt/squeezeplay$ grep '!=' share/jive/applets/NowPlaying/NowPlayingApplet.lua  | wc -l
1

No biggie. I later found other occurrences, but far fewer than for ~= . Feel free to close.

of@openframe:/opt/squeezeplay$ find . -name '*.lua' -exec grep '!=' {} \+ | wc -l
27
of@openframe:/opt/squeezeplay$ find . -name '*.lua' -exec grep '~=' {} \+ | wc -l
396