| 05-15-2008, 05:44 PM | #1 |
JASS:function U2I takes unit u returns integer return u return 0 endfunction function H2I takes handle h returns integer return h return 0 endfunction What is the fastest solution, if i use an unit variable. For me, it should be the U2I function. and yes i know the difference should be insignificant ... |
| 05-15-2008, 05:50 PM | #2 |
imo no difference... only h2i is more universal. =) |
| 05-15-2008, 05:54 PM | #3 |
First of all, what is the question?? Second, I suppose the conversion from unit to handle does not have any overhead at all. |
| 05-15-2008, 05:56 PM | #4 |
H2I is insignificantly faster, H2I is also significantly more universal. |
| 05-15-2008, 06:22 PM | #5 | |
Quote:
stupid question "stupid" answers =) |
| 05-15-2008, 07:55 PM | #6 |
It probably has to type cast from unit to handle, which shouldn't take any time really. It's probably less than the difference between typing '1.' and '1' for a real in the WE. |
| 05-15-2008, 10:31 PM | #7 |
I'm going to ahead and say there will be no difference whatsoever, except the inability to pass non-units to U2I. Both should compile to the same byte code. Of course, it depends on Blizzard handled variable types. You can usually get away with totally ignoring the type at run-time (they do check it in native calls, but there is no native call here). |
| 05-15-2008, 10:42 PM | #8 | |
Quote:
|
| 05-15-2008, 11:22 PM | #9 |
OMG !!! BRAIN EATING TT close this thread please !!! // btw this is pure zadrotstwo =) discusing about 1 proccesor tact saving... =O i am scared... |
| 05-15-2008, 11:35 PM | #10 | |
Quote:
|
| 05-15-2008, 11:49 PM | #11 |
yes but it's the uber thread >.< it's kind a what is faster: 3+1 or 2+2 ? see yes 2+2 maybe is faster but (i don't really know) but in fact it's 0 differense. btw precached timers are also VERY save. // cause i align handle stack before creting them xD |
| 05-15-2008, 11:55 PM | #12 | |
Quote:
|
| 05-16-2008, 12:02 AM | #13 |
when you will post the Heroes ? =) |
| 05-16-2008, 12:06 AM | #14 |
when Dusk comes back? Friday sounds like the perfect day of the week to start the poll anyways. |
| 05-16-2008, 12:08 AM | #15 |
i have friday xD + RD is online... |
