From 65569a6dd772e9a132a33e459022fef479582b47 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Asia=20J=C4=99drzejewska-Szmek?= <asia@in.waw.pl>
Date: Fri, 20 Jan 2017 15:49:28 -0500
Subject: [PATCH] Remove useless variable
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Ï€ is defined as a constant in the headers, no need to create a
variable. Also constify some other variables. No functional change.
---
 moose-core/biophysics/DifShell.cpp | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/moose-core/biophysics/DifShell.cpp b/moose-core/biophysics/DifShell.cpp
index 98fe9a2b..6012568f 100644
--- a/moose-core/biophysics/DifShell.cpp
+++ b/moose-core/biophysics/DifShell.cpp
@@ -571,9 +571,8 @@ void DifShell::localReinit_0( const Eref& e, ProcPtr p )
 {
 	dCbyDt_ = leak_;
 	
-	double Pi = M_PI;
-	double dOut = diameter_;
-	double dIn = diameter_ - thickness_;
+	const double dOut = diameter_;
+	const double dIn = diameter_ - thickness_;
 	
 	switch ( shapeMode_ )
 	{
@@ -582,13 +581,13 @@ void DifShell::localReinit_0( const Eref& e, ProcPtr p )
 	 */
 	case 0:
 		if ( length_ == 0.0 ) { // Spherical shell
-			volume_ = ( Pi / 6.0 ) * ( dOut * dOut * dOut - dIn * dIn * dIn );
-			outerArea_ = Pi * dOut * dOut;
-			innerArea_ = Pi * dIn * dIn;
+			volume_ = ( M_PI / 6.0 ) * ( dOut * dOut * dOut - dIn * dIn * dIn );
+			outerArea_ = M_PI * dOut * dOut;
+			innerArea_ = M_PI * dIn * dIn;
 		} else { // Cylindrical shell
-			volume_ = ( Pi * length_ / 4.0 ) * ( dOut * dOut - dIn * dIn );
-			outerArea_ = Pi * dOut * length_;
-			innerArea_ = Pi * dIn * length_;
+			volume_ = ( M_PI * length_ / 4.0 ) * ( dOut * dOut - dIn * dIn );
+			outerArea_ = M_PI * dOut * length_;
+			innerArea_ = M_PI * dIn * length_;
 		}
 		
 		break;
@@ -597,8 +596,8 @@ void DifShell::localReinit_0( const Eref& e, ProcPtr p )
 	 * Cylindrical Slice
 	 */
 	case 1:
-		volume_ = Pi * diameter_ * diameter_ * thickness_ / 4.0;
-		outerArea_ = Pi * diameter_ * diameter_ / 4.0;
+		volume_ = M_PI * diameter_ * diameter_ * thickness_ / 4.0;
+		outerArea_ = M_PI * diameter_ * diameter_ / 4.0;
 		innerArea_ = outerArea_;
 		break;
 	
-- 
GitLab