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 <freedesktop@treblig.org>
Tested-by: Jenkins
This commit is contained in:
Bogdan Buzea 2024-10-21 17:51:03 +02:00 committed by David Gilbert
parent 1259a073c1
commit 98355e65aa

View file

@ -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) * (