Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qhighdpiscaling: de-pessimize qEnvironmentVariableOptional*() functions
Don't call qEnvironmentVariableIsSet(), since it locks the environment mutex. Since qgetenv() and qEnvironmentVariable() both report whether the value was set (returning non-isNull()), we can avoid the extra mutex lock (and envvar lookup) by just calling those and then checking for isNull(). In qEnvironmentVariableOptionalReal(), in addition, use qgetenv() instead of qEnvironmentVariable(). While on Windows, that may convert encoding, QString::toDouble() first converts to Latin-1, and only then converts to double, so we avoid one encoding conversion, even on Windows; on Unix we avoid two. Amends 4d1f13f. Pick-to: 6.9 6.8 6.5 Change-Id: I6803e2277b324c2568726765245681bcbf517362 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
- Loading branch information