03.04.2013, 18:19
(
Last edited by AndreT; 03/04/2013 at 06:27 PM.
Reason: To op.
)
@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.
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.