Hate
конь вакуумный
offline
Опыт:
43,137Активность: |
Есть ли тут утечки?
вопсчем код
» нажминаминя
опытные люди, просмотрите и отпишитесь, ибо собираюсь брать это как каркас для других, и нехочетсо узнать о чем либо поздновато |
13.04.2012, 17:53 | #1
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vadik29
Choice Battle 1.6а
offline
Опыт:
15,845Активность: |
Hatsume_Hate, тонна
[+] замечание от Suite: дезинформация
Отредактировано Vadik29, 13.04.2012 в 18:10. |
13.04.2012, 17:58 | #2
+1/−1
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Hate
конь вакуумный
offline
Опыт:
43,137Активность: |
|
13.04.2012, 18:05 | #3
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Nerevar
I'll be back!
offline
Опыт:
18,352Активность: |
передаваемых юнитов не надо обнулять |
13.04.2012, 18:07 | #4
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Klop
Папа римский
offline
Опыт:
13,006Активность: |
Vadik29:
лол),незнаешь не пиши уже
это не утечка это функция вызываеь функцию GetUnitAbilityLevel для оптимизации лучше использовать это GetUnitAbilityLevel ибо происходит ненужный вызов функции ,но это не является утечкой
Vadik29:
щас расплачусь,тоже самое что и в первом варианте)
а вот что касаеться текстагов то утечек много,найди нормальную готовую функцию текстага безутечный и юзай и раскрой все функции БЖ |
13.04.2012, 18:08 | #5
+2/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vadik29
Choice Battle 1.6а
offline
Опыт:
15,845Активность: |
Klop, эти функции унылое говно,т.к. вызывают тормоза и кратковременный засор памяти имхо это вовсе не нужно, так что я все правильно сказал.... [+] замечание от Suite: если функции уг это не означает что они утечны
|
13.04.2012, 18:11 | #6
+0/−1
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Klop
Папа римский
offline
Опыт:
13,006Активность: |
Vadik29:
ты ответил на свой вопрос сам,утечка это не временный засор |
13.04.2012, 18:15 | #7
+1/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Nerevar
I'll be back!
offline
Опыт:
18,352Активность: |
Vadik29, не надо дезинформировать автора и других людей почитай чтоли статьи,ибо пропускаешь настоящие утечки у автора только лишнее обнуление передаваемых аргументов,все остальное в норме,включая использование текстагов |
13.04.2012, 18:15 | #8
+1/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
DaeDR
offline
Опыт:
8,074Активность: |
» Код
А вообще стоит подумать над оптимизацией и как-то сделать это через цикл что-ли |
13.04.2012, 18:19 | #9
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vadik29
Choice Battle 1.6а
offline
Опыт:
15,845Активность: |
Nerevar, да с учетом, что можно сделать лучше, то у него все в норме..... да и в добавок я сказал как будет лучше, а остальное уже за автором.... |
13.04.2012, 18:20 | #10
+0/−1
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Nerevar
I'll be back!
offline
Опыт:
18,352Активность: |
DaeDR:
цикл ведь дает прирост читаемости,но не производительности(!) |
13.04.2012, 18:20 | #11
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
DaeDR
offline
Опыт:
8,074Активность: |
И еще читабельность бы повысить. Например:
Так будет удобнее разбирать, что в каком if'e находится |
13.04.2012, 18:21 | #12
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
16GB
GhostOne User
offline
Опыт:
60,317Активность: |
подобное пишется так
|
13.04.2012, 18:21 | #13
+1/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Nerevar
I'll be back!
offline
Опыт:
18,352Активность: |
Vadik29:
раскрытие бж,в которых просто вызов другой функции - можно раскрытие бж,в которых много строк - тут уже надо подумать что лучше - мизерный прирост скорости или читаемость и размер кода |
13.04.2012, 18:23 | #14
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
DaeDR
offline
Опыт:
8,074Активность: |
И вообще стрит вынести IsUnitType(uCaster, UNIT_TYPE_HERO)
|
13.04.2012, 18:24 | #15
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Hate
конь вакуумный
offline
Опыт:
43,137Активность: |
DaeDR:
и что изменилось, не замечаю)
раскрывать неумею)
DaeDR:
хорошая мысль |
13.04.2012, 18:24 | #16
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
DaeDR
offline
Опыт:
8,074Активность: |
И зачем делать так?
» Код
Если проще так:
|
13.04.2012, 18:28 | #17
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Vadik29
Choice Battle 1.6а
offline
Опыт:
15,845Активность: |
вот с отступами,также провел оптимизацию
» код
Отредактировано Vadik29, 13.04.2012 в 18:35. |
13.04.2012, 18:29 | #18
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
DaeDR
offline
Опыт:
8,074Активность: |
Если я ничего не напутал, то начало функции улучшил слегка:
Надеюсь, хоть половина будет понятна Еще чуть поправил
» Код
DaeDR добавил: Дальше уже "темный лес", который понятен только автору как и бывает в 80% случаях |
13.04.2012, 18:42 | #19
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|
Hate
конь вакуумный
offline
Опыт:
43,137Активность: |
DaeDR:
=)
|
13.04.2012, 18:47 | #20
+0/−0
Профиль |
Приват |
Поиск |
Цитата |
IP: Записан
|