Android - for loop: for (boolean bool = true; ; bool = false) -


the following snippet part of human step detection android app downloaded play store. since works fine, assume codes make sense.

private boolean ismotion(float[] paramarrayoffloat) {     if ((math.abs(this.moldacc[0] - paramarrayoffloat[0]) > 1.0f) || (math.abs(this.moldacc[1] - paramarrayoffloat[1]) > 1.0f) ||         (math.abs(this.moldacc[2] - paramarrayoffloat[2]) > 1.0f));         (boolean bool = true; ; bool = false)         {             this.moldacc[0] = paramarrayoffloat[0];             this.moldacc[1] = paramarrayoffloat[1];             this.moldacc[2] = paramarrayoffloat[2];             return bool;         } } 

regarding following codes, have 2 questions:

1) looping condition:

for (boolean bool = true; ; bool = false){}

this condition means every time loop starts, bool set true. when loop finished, bool set false. purpose of doing so? in addition, point of doing here?

2) if condition:

if ((math.abs(this.moldacc[0] - paramarrayoffloat[0]) > 1.0f) || (math.abs(this.moldacc[1] - paramarrayoffloat[1]) > 1.0f) || (math.abs(this.moldacc[2] -paramarrayoffloat[2]) > 1.0f));

the if condition directly finished adding ; right after condition. have no idea why has been done.

someone please me. much!!!

the for-loop 1 could useful in case want different first time through loop:

for (boolean firsttime = true; ; firsttime = false) {     if (firsttime)         dostuff();     dootherstuff(); } 

it's not how i'd choose guess it's plausible. in case, body of loop makes setting of boolean value irrelevant since returns no matter what.

how describe not totally correct way. first time loop starts, it's set true, it's when iteration of loop restarts gets set false.

when loop ends (presumably break since otherwise loop doesn't end), boolean not set - it's scope limited loop itself.

the if-statement 1 (with no body) useful if there side-effect in conditions (such function call making changes somewhere). not case standard math function 1 seems truly useless.

bottom line, code appears have been written severely broken code generator or coder either psychopathic or has little ability (or maybe, maybe, it's not yet finished).


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -