Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/unit.c')
-rw-r--r--source/blender/blenkernel/intern/unit.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 73bf149bf2a..b55f80c6473 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -802,17 +802,12 @@ static char *find_next_negative(const char *str, const char *remaining_str)
static char *find_next_op(const char *str, char *remaining_str, int len_max)
{
int i;
- bool scientific_notation = false;
for (i = 0; i < len_max; i++) {
if (remaining_str[i] == '\0') {
return remaining_str + i;
}
if (ch_is_op(remaining_str[i])) {
- if (scientific_notation) {
- scientific_notation = false;
- }
-
/* Make sure we don't look backwards before the start of the string. */
if (remaining_str != str && i != 0) {
/* Check for velocity or acceleration (e.g. '/' in 'ft/s' is not an op). */
@@ -822,8 +817,7 @@ static char *find_next_op(const char *str, char *remaining_str, int len_max)
}
/* Check for scientific notation. */
- if (remaining_str[i - 1] == 'e' || remaining_str[i - 1] == 'E') {
- scientific_notation = true;
+ if (ELEM(remaining_str[i - 1], 'e', 'E')) {
continue;
}
@@ -1184,7 +1178,7 @@ bool BKE_unit_replace_string(
/* Any operators after this? */
for (ch = str_found + 1; *ch != '\0'; ch++) {
- if (*ch == ' ' || *ch == '\t') {
+ if (ELEM(*ch, ' ', '\t')) {
continue;
}
op_found = (ch_is_op(*ch) || ELEM(*ch, ',', ')'));