Quote:
Originally Posted by MrPickles
but like i said, if u use it many times( > 1 ) in the function, u should make a static var
|
I think this makes sence only if used very often, e.g. inside client_...think or some Ham_* hooks
Quote:
Originally Posted by fysiks
While it's theoretically possible, I'm quite sure that the compiler won't optimize that out of the code. As long as it's not called really often or isn't really large, it really won't matter which option you choose. For the cases where it's large or called often, you would use static.
In your case, using it directly without variable creation is probably the best way to go about it.
|
This is the reply I waited for. I also tried to use amxxdump and I think it says you're right.
Code:
0x210 PROC ; public Ham_Item_Deploy_Pre(iEnt)
0x214 BREAK
0x218 BREAK
; new id
0x21C STACK 0xFFFFFFFC ; allocate 1 cells
0x224 PUSH.C 0x12
0x22C PUSH.S 0xC ; iEnt
0x234 PUSH.C 0x8
0x23C SYSREQ.C 0x7 ; pev
0x244 STACK 0xC ; free 3 cells
0x24C STOR.S.pri 0xFFFFFFFC ; id
0x254 BREAK
0x258 PUSH.ADR 0xFFFFFFFC ; id
0x260 PUSH.C 0xF4
0x268 PUSH.C 0x0
0x270 PUSH.C 0xC
0x278 SYSREQ.C 0x8 ; console_print
0x280 STACK 0x10 ; free 4 cells
0x288 STACK 0x4 ; free 1 cells
0x290 ZERO.pri
0x294 RETN
Code:
0x298 PROC ; public Ham_Item_Deploy_Pre2(iEnt)
0x29C BREAK
0x2A0 BREAK
0x2A4 PUSH.C 0x12
0x2AC PUSH.S 0xC ; iEnt
0x2B4 PUSH.C 0x8
0x2BC SYSREQ.C 0x7 ; pev
0x2C4 STACK 0xC ; free 3 cells
0x2CC HEAP 0x4
0x2D4 STOR.I
0x2D8 PUSH.alt
0x2DC PUSH.C 0x158
0x2E4 PUSH.C 0x0
0x2EC PUSH.C 0xC
0x2F4 SYSREQ.C 0x8 ; console_print
0x2FC STACK 0x10 ; free 4 cells
0x304 HEAP 0xFFFFFFFC
0x30C ZERO.pri
0x310 RETN
__________________