Mercurial > hgrepos > Python > libs > ConfigMix
comparison configmix/config.py @ 504:4dbc16ff2670
.lstrip() seems to be a little bit faster than .rstrip() when testing whether quoting is needed
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 18 Dec 2021 02:35:42 +0100 |
| parents | a56f1d97a3f3 |
| children | dffa692751b1 |
comparison
equal
deleted
inserted
replaced
| 503:a56f1d97a3f3 | 504:4dbc16ff2670 |
|---|---|
| 261 | 261 |
| 262 See also the :ref:`quoting` section. | 262 See also the :ref:`quoting` section. |
| 263 | 263 |
| 264 """ | 264 """ |
| 265 # Quick check whether all of the chars are in _QUOTE_SAFE | 265 # Quick check whether all of the chars are in _QUOTE_SAFE |
| 266 if not s.rstrip(_QUOTE_SAFE): | 266 if not s.lstrip(_QUOTE_SAFE): |
| 267 return s | 267 return s |
| 268 | 268 |
| 269 # Slow path | 269 # Slow path |
| 270 re_encode = False | 270 re_encode = False |
| 271 if PY2: | 271 if PY2: |
