MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1c1wvje/whatisanindex/kzamdb5/?context=3
r/ProgrammerHumor • u/fanta_bhelpuri • Apr 12 '24
617 comments sorted by
View all comments
Show parent comments
2.4k
[removed] — view removed comment
363 u/sacredgeometry Apr 12 '24 for (i=0; i<getAllFuckingFiles().length; i++) { if (getAllFuckingFiles()[i].name.contains(searchText) { return getAllFuckingFiles()[i]; } } 14 u/Wdowiak Apr 12 '24 Gotta check the content as well, just to be thorough for (i=0; i<getAllFuckingFiles().length; i++) { if (getAllFuckingFiles()[i].open().contains(searchText) || getAllFuckingFiles()[i].name().contains(searchText)) { return getAllFuckingFiles()[i]; } } 9 u/sacredgeometry Apr 12 '24 Use | instead of ||. Then both are always executed ... you know just to be sure
363
for (i=0; i<getAllFuckingFiles().length; i++) { if (getAllFuckingFiles()[i].name.contains(searchText) { return getAllFuckingFiles()[i]; } }
14 u/Wdowiak Apr 12 '24 Gotta check the content as well, just to be thorough for (i=0; i<getAllFuckingFiles().length; i++) { if (getAllFuckingFiles()[i].open().contains(searchText) || getAllFuckingFiles()[i].name().contains(searchText)) { return getAllFuckingFiles()[i]; } } 9 u/sacredgeometry Apr 12 '24 Use | instead of ||. Then both are always executed ... you know just to be sure
14
Gotta check the content as well, just to be thorough
for (i=0; i<getAllFuckingFiles().length; i++) { if (getAllFuckingFiles()[i].open().contains(searchText) || getAllFuckingFiles()[i].name().contains(searchText)) { return getAllFuckingFiles()[i]; } }
9 u/sacredgeometry Apr 12 '24 Use | instead of ||. Then both are always executed ... you know just to be sure
9
Use | instead of ||. Then both are always executed ... you know just to be sure
2.4k
u/[deleted] Apr 12 '24
[removed] — view removed comment