Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
iiii90854yArray length is a constant in this case. There's no reason for such "optimization". Though the loops are stupid indeed.
-
Hazarth95194yI don't think this code actually does anything... What?
So start i at 3, assume array.length() is 5...
If 3 < 5
let j = 2
If i > len(arr)*2, so 3 > 5*2
Do onScan()
Is the "i" in the nested loop a typo?
But even if It's supposed to be "j"
The for loop is just gonna fail because we already know that array.length() > 3, otherwise it wouldn't even execute due to the outside loop...
So if j starts on 2 and array.length() is bigger than 3 and *2 then j > array.length()*2 is never going to be true
I don't know if there's more typos in what you posted, or this code does literally nothing... What am I missing? -
@Hazarth maybe the I is typo I just copied from their source... And paste it here.
-
Hazarth95194y@johnmelodyme
I mean, It's literally saying
i = 3
x = array.length()
if (i < x && i > x*2) onScan()
I can't even -
@iiii the app keep crashing , maybe this is the cause. But idc because is not my app , it is the government app
-
But that's how government jobs work 🤷🏻
We have a saying:
"Tike raho pagla,
Kaam karega agla"
Which translates to:
"Somehow survive (till retirement),
The next guy after you will do the real work"
Related Rants
-
johnmelodyme41So today this Mother F**ker get HR to back him up to accuse me of not communicating well in the team because I...
-
johnmelodyme62[WARNING] THIS RANT IS NOT FOR HULKS OR SHE-HULKS Here we fucking go again, currently, the time is 1:09 am in...
-
johnmelodyme4!rant Yes! finally 4588 people got fed. I am targeting 10k of people. Get free food from my food bank. Prev...
MySejahtera is not a good appliaction at all! They just use Sqlite or Shared Preferences in the app for keeping the data local. (Just local?) As soon as you clear cache or data, The user no longer exist! Like wtf ?
So I decompile the app and review the source code, the code is not even properly obfuscated(That's why I can read it). There's a part of the code on a for loop went
```
for (int i = 3; i < array.length(); i++)
{
for (int j = 2; i > array.length() *2; j ++ )
{
onScan();
}
}
```
Which is unacceptable!
First , why nested for loops?
Second, instead of declare 'array.length()' multiple times why not declared it global for once?
No wonder the initial state of the app is buggy as hell.
rant
malaysia
mysejatera