From bd66b4ad1180ad4065fa5c2f00341ef19fcb6b12 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Thu, 27 Sep 2018 23:34:06 -0400 Subject: [PATCH] Fixed spacing and set initial nullptr values --- src/operations/operators.cpp | 4 ++-- src/variables/environment.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/operations/operators.cpp b/src/operations/operators.cpp index 291bf14..0da7670 100644 --- a/src/operations/operators.cpp +++ b/src/operations/operators.cpp @@ -196,7 +196,7 @@ struct Value* equals(struct Value* x, struct Value* y) { std::cerr << "Error, cannot compare a string with another data type." << std::endl; } - struct Value* ans; + struct Value* ans = nullptr; // Destruct all four cases if (x->type == LONG && y->type == LONG) { @@ -224,7 +224,7 @@ struct Value* not_equals(struct Value* x, struct Value* y) { std::cerr << "Error, cannot compare a string with another data type." << std::endl; } - struct Value* ans; + struct Value* ans= nullptr; // Destruct all four cases if (x->type == LONG && y->type == LONG) { diff --git a/src/variables/environment.cpp b/src/variables/environment.cpp index 5e21922..ecb6768 100644 --- a/src/variables/environment.cpp +++ b/src/variables/environment.cpp @@ -15,9 +15,9 @@ struct Variable* find_variable(struct Environment* env, std::string id) { return element->id == id; }); - if (result != env->vars.end()) { - return *result; - } + if (result != env->vars.end()) { + return *result; + } return nullptr; }