From 98355e65aa105bfdaf7d7907d8be6bcc87784f72 Mon Sep 17 00:00:00 2001 From: Bogdan Buzea Date: Mon, 21 Oct 2024 17:51:03 +0200 Subject: [PATCH] tdf#163486: PVS: Identical branches V1037 Two or more case-branches perform the same actions. Check lines: 562, 587 Change-Id: I99c433daf9072b4e070a2ba0095d51591ebf7810 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175359 Reviewed-by: David Gilbert Tested-by: Jenkins --- scaddins/source/pricing/black_scholes.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scaddins/source/pricing/black_scholes.cxx b/scaddins/source/pricing/black_scholes.cxx index 98baa307c100..aa417f21af2d 100644 --- a/scaddins/source/pricing/black_scholes.cxx +++ b/scaddins/source/pricing/black_scholes.cxx @@ -559,6 +559,7 @@ static double barrier_term(double S, double vol, double rd, double rf, double c = 12.0*(rd-rf)/(vol*vol*vol*vol); // helper -db/dvol switch(greek) { case types::Value: + case types::Theta: val = vanilla_trunc(sc*S,vol,rd,rf,tau,K,B1,B2,pc,fd,greek) - pow(B/S,a)* vanilla_trunc(sc*B*B/S,vol,rd,rf,tau,K,B1,B2,pc,fd,greek); @@ -583,11 +584,6 @@ static double barrier_term(double S, double vol, double rd, double rf, vanilla_trunc(sc*B*B/S,vol,rd,rf,tau,K,B1,B2,pc,fd,types::Gamma) ); break; - case types::Theta: - val = vanilla_trunc(sc*S,vol,rd,rf,tau,K,B1,B2,pc,fd,greek) - - pow(B/S,a)* - vanilla_trunc(sc*B*B/S,vol,rd,rf,tau,K,B1,B2,pc,fd,greek); - break; case types::Vega: val = vanilla_trunc(sc*S,vol,rd,rf,tau,K,B1,B2,pc,fd,greek) - pow(B/S,a) * (