scaddins/source/pricing/black_scholes.cxx |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

New commits:
commit 98355e65aa105bfdaf7d7907d8be6bcc87784f72
Author:     Bogdan Buzea <buzea.bog...@libreoffice.org>
AuthorDate: Mon Oct 21 17:51:03 2024 +0200
Commit:     David Gilbert <freedesk...@treblig.org>
CommitDate: Wed Nov 6 22:42:47 2024 +0100

    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 <freedesk...@treblig.org>
    Tested-by: Jenkins

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

Reply via email to