From 1bde33cd793d87ca3dd0dd445cd3dfe37cdb7e47 Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Mon, 13 Dec 2021 13:48:21 +0100 Subject: [PATCH] avoid return of unitialized variable --- src/BTCSDiffusion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BTCSDiffusion.cpp b/src/BTCSDiffusion.cpp index 9f70440..ab7d2ea 100644 --- a/src/BTCSDiffusion.cpp +++ b/src/BTCSDiffusion.cpp @@ -113,7 +113,7 @@ void BTCSDiffusion::simulate(std::vector &c, } double BTCSDiffusion::getBCFromTuple(int index, double nearest_value) { - double val; + double val = -1; int type = std::get<0>(bc[index]); if (type == BTCSDiffusion::BC_NEUMANN) { @@ -122,7 +122,7 @@ double BTCSDiffusion::getBCFromTuple(int index, double nearest_value) { } else if (type == BTCSDiffusion::BC_DIRICHLET) { val = std::get<1>(bc[index]); } else { - // some error handling here. Type was set to wrong value. + // TODO: implement error handling here. Type was set to wrong value. } return val;