Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Useless processing in Spline3.converge() #3138

Closed
asfimport opened this issue Jun 5, 2013 · 2 comments
Closed

Useless processing in Spline3.converge() #3138

asfimport opened this issue Jun 5, 2013 · 2 comments

Comments

@asfimport
Copy link
Collaborator

Adrian Nistor (Bug 55065):
The problem appears in version 2.9 and in revision 1489981. I
attached a one-line patch that fixes it.

In method "Spline3.converge", the loop from 0 to "_n" should break
immediately after "converge" is set to "false". All the iterations
after "converge" is set to "false" do not perform any useful work
because the "if (converge)" statement will always evaluate to "false"
and the "true" branch will never be taken again for the remaining
iterations.

Created attachment patch.diff: patch

patch.diff
Index: src/components/org/apache/jmeter/visualizers/Spline3.java
===================================================================
--- src/components/org/apache/jmeter/visualizers/Spline3.java	(revision 1489981)
+++ src/components/org/apache/jmeter/visualizers/Spline3.java	(working copy)
@@ -271,6 +271,7 @@
                 lineSum = lineSum - Math.abs(_A[i][i]);
                 if (lineSum > Math.abs(_A[i][i])) {
                     converge = false;
+                    break;
                 }
             }
         }

Severity: normal
OS: All

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Thanks for patch, applied.

Date: Wed Jun 5 18:59:09 2013
New Revision: 1490003

URL: http://svn.apache.org/r1490003
Log:
#3138 - wasted work in Spline3.converge()
#3138

Modified:
jmeter/trunk/src/components/org/apache/jmeter/visualizers/Spline3.java
jmeter/trunk/xdocs/changes.xml

@asfimport
Copy link
Collaborator Author

@pmouawad (migrated from Bugzilla):
Date: Wed Jun 5 19:06:31 2013
New Revision: 1490009

URL: http://svn.apache.org/r1490009
Log:
#3138 - wasted work in Spline3.converge()
Bug renaming
#3138

Modified:
jmeter/trunk/xdocs/changes.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant