Reading line X from a file
#5

@leonardo1434:
Your GetLine function, on numerous occasions, leaves the file handle open. This can be a bad practice or result in memory staying allocated after a server crash (I don't think the PAWN api takes care of closing it).

Anyways, I don't think this is exactly what MP2 is looking for, either.

@OP:
If raw performance is what you're seeking, don't be afraid to "integrate" this function with your code natively. This will save you a function call, but more importantly, will help you get rid of the elements of the function that are not necessary for you (for example the check of whether the line parameter is higher than 0 - in 99% cases you already KNOW it is, unless it is user-input you're handling).
If you want more specific code advice on how to get the top notch speed out of your code, you're going to need to post some.
Reply


Messages In This Thread
Reading line X from a file - by MP2 - 03.04.2013, 16:53
Re: Reading line X from a file - by OrMisicL - 03.04.2013, 17:16
Re: Reading line X from a file - by MP2 - 03.04.2013, 17:30
Re: Reading line X from a file - by leonardo1434 - 03.04.2013, 18:11
Re: Reading line X from a file - by AndreT - 03.04.2013, 18:19
Re: Reading line X from a file - by OrMisicL - 03.04.2013, 18:25
Re: Reading line X from a file - by leonardo1434 - 03.04.2013, 18:32

Forum Jump:


Users browsing this thread: 1 Guest(s)