Simplify and speed up hot functions GenerateRandomID() and CreateXmlTag()#286
Conversation
…ag() This commit uses single quotes for attributes instead of double quotes
| @@ -405,10 +405,8 @@ function EncodeEntities (string) { | |||
|
|
|||
|
|
|||
| function GenerateRandomID () { | |||
There was a problem hiding this comment.
It's not Random, so maybe better call it GenerateID.
|
What’s the motivation for changing to apostrophes? |
|
If you want to avoid all the calls to Chr(34), just assign it to a variable? I find XML that uses single quotes to be really ugly. |
|
I have no aesthetic attachment to either single or double quotes. In fact, it's possible to also escape double quotes, which I did in #289. (By the way, I opened that new pull request because I don't like pushing a commit to this branch that immediately reverts the previous commit, so there's some aesthetic preferences of mine ;-).) |
|
If it makes no difference, then double quotes would be preferable as they are more in line with common practice (and also aligns with Verovio). |
|
If we're all happy with the double quote pull request, I'd close this one and merge the other one. |
|
I'm ok with that. |
This changes attributes quotes from double to single quotes, but avoids a lot of string concatenation and Chr() function calls.