[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/38] qapi/common.py: Replace one-letter 'c' variable
From: |
John Snow |
Subject: |
[PATCH v2 11/38] qapi/common.py: Replace one-letter 'c' variable |
Date: |
Tue, 22 Sep 2020 17:00:34 -0400 |
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/common.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py
index bddfb5a9e5..682e74fe65 100644
--- a/scripts/qapi/common.py
+++ b/scripts/qapi/common.py
@@ -30,14 +30,14 @@ def camel_to_upper(value):
new_name = ''
length = len(c_fun_str)
for i in range(length):
- c = c_fun_str[i]
- # When c is upper and no '_' appears before, do more checks
- if c.isupper() and (i > 0) and c_fun_str[i - 1] != '_':
+ char = c_fun_str[i]
+ # When char is upper case and no '_' appears before, do more checks
+ if char.isupper() and (i > 0) and c_fun_str[i - 1] != '_':
if i < length - 1 and c_fun_str[i + 1].islower():
new_name += '_'
elif c_fun_str[i - 1].isdigit():
new_name += '_'
- new_name += c
+ new_name += char
return new_name.lstrip('_').upper()
--
2.26.2
- Re: [PATCH v2 29/38] qapi/gen.py: delint with pylint, (continued)
- [PATCH v2 10/38] qapi/common.py: delint with pylint, John Snow, 2020/09/22
- [PATCH v2 27/38] qapi/gen.py: Remove unused parameter, John Snow, 2020/09/22
- [PATCH v2 23/38] qapi/source.py: delint with pylint, John Snow, 2020/09/22
- [PATCH v2 11/38] qapi/common.py: Replace one-letter 'c' variable,
John Snow <=
- [PATCH v2 03/38] qapi: move generator entrypoint into module, John Snow, 2020/09/22
- [PATCH v2 20/38] qapi/commands.py: add notational type hints, John Snow, 2020/09/22