aboutsummaryrefslogtreecommitdiff
path: root/py/objstr.c
diff options
context:
space:
mode:
authorstijn <stijn@ignitron.net>2020-04-16 09:13:57 +0200
committerDamien George <damien.p.george@gmail.com>2020-04-23 11:24:25 +1000
commit84fa3312cfa7d2237d4b56952f2cd6e3591210c4 (patch)
treedc2b3e67bad9969fc5792ca0822798d58addf174 /py/objstr.c
parentd6243568a05d423b58522435c3779975acbf56dd (diff)
all: Format code to add space after C++-style comment start.
Note: the uncrustify configuration is explicitly set to 'add' instead of 'force' in order not to alter the comments which use extra spaces after // as a means of indenting text for clarity.
Diffstat (limited to 'py/objstr.c')
-rw-r--r--py/objstr.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 548fa1bb3..a276a255e 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -284,11 +284,11 @@ const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle,
}
for (;;) {
if (memcmp(&haystack[str_index], needle, nlen) == 0) {
- //found
+ // found
return haystack + str_index;
}
if (str_index == str_index_end) {
- //not found
+ // not found
break;
}
str_index += direction;
@@ -396,7 +396,7 @@ mp_obj_t mp_obj_str_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i
case MP_BINARY_OP_CONTAINS:
return mp_obj_new_bool(find_subbytes(lhs_data, lhs_len, rhs_data, rhs_len, 1) != NULL);
- //case MP_BINARY_OP_NOT_EQUAL: // This is never passed here
+ // case MP_BINARY_OP_NOT_EQUAL: // This is never passed here
case MP_BINARY_OP_EQUAL: // This will be passed only for bytes, str is dealt with in mp_obj_equal()
case MP_BINARY_OP_LESS:
case MP_BINARY_OP_LESS_EQUAL:
@@ -849,7 +849,7 @@ STATIC mp_obj_t str_uni_strip(int type, size_t n_args, const mp_obj_t *args) {
}
assert(last_good_char_pos >= first_good_char_pos);
- //+1 to accommodate the last character
+ // +1 to accommodate the last character
size_t stripped_len = last_good_char_pos - first_good_char_pos + 1;
if (stripped_len == orig_str_len) {
// If nothing was stripped, don't bother to dup original string