Redundant Assignments
Reported by
wangsong...@gmail.com,
Jan 31 2018
|
|
Issue description
UserAgent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Platform: chrome://android
Steps to reproduce the problem:
Our tool DeepTect detect redundant assignments:
chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java
private static void initContants() {
//This controls the viscous fluid effect (how much of it)
sViscousFluidScale = 8.0f;
// must be set to 1.0 (used in viscousFluid())
sViscousFluidNormalize = 1.0f;
sViscousFluidNormalize = 1.0f / viscousFluid(1.0f);
}
In the above code snippet, the variable "sViscousFluidNormalize" is assigned twice consecutively, which makes the first assignment redundant.
What is the expected behavior?
What went wrong?
Our tool DeepTect detect redundant assignments:
chrome/android/java/src/org/chromium/chrome/browser/compositor/layouts/phone/stack/StackScroller.java
private static void initContants() {
//This controls the viscous fluid effect (how much of it)
sViscousFluidScale = 8.0f;
// must be set to 1.0 (used in viscousFluid())
sViscousFluidNormalize = 1.0f;
sViscousFluidNormalize = 1.0f / viscousFluid(1.0f);
}
In the above code snippet, the variable "sViscousFluidNormalize" is assigned twice consecutively, which makes the first assignment redundant.
Did this work before? N/A
Chrome version: 63.0.3239.132 Channel: n/a
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version:
,
Feb 2 2018
Thanks for your quick feedback, I just checked the code and you are right. This is good case to improve my tool. |
|
►
Sign in to add a comment |
|
Comment 1 by dtapu...@chromium.org
, Feb 2 2018