mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-14 21:10:27 +01:00
dtoc: Add a comment about string replace in conv_name_to_c()
This function uses several separate string replaces where a regular expression might seem more reasonable. Add a comment justifying the way it is currently done. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
fa0ea5b09e
commit
30107b08d7
1 changed files with 3 additions and 0 deletions
|
|
@ -46,6 +46,9 @@ VAL_PREFIX = 'dtv_'
|
|||
def conv_name_to_c(name):
|
||||
"""Convert a device-tree name to a C identifier
|
||||
|
||||
This uses multiple replace() calls instead of re.sub() since it is faster
|
||||
(400ms for 1m calls versus 1000ms for the 're' version).
|
||||
|
||||
Args:
|
||||
name: Name to convert
|
||||
Return:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue