Click here to Skip to main content
15,891,734 members
Home / Discussions / C#
   

C#

 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 4:12
BobJanova16-Jun-11 4:12 
GeneralRe: help optimize functions Pin
V.16-Jun-11 5:43
professionalV.16-Jun-11 5:43 
GeneralRe: help optimize functions Pin
Not Active16-Jun-11 10:17
mentorNot Active16-Jun-11 10:17 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 10:29
BobJanova16-Jun-11 10:29 
GeneralRe: help optimize functions Pin
Not Active16-Jun-11 11:56
mentorNot Active16-Jun-11 11:56 
GeneralRe: help optimize functions Pin
BobJanova16-Jun-11 22:55
BobJanova16-Jun-11 22:55 
GeneralRe: help optimize functions Pin
PIEBALDconsult16-Jun-11 15:52
mvePIEBALDconsult16-Jun-11 15:52 
AnswerRe: help optimize functions Pin
Pete O'Hanlon16-Jun-11 4:30
mvePete O'Hanlon16-Jun-11 4:30 
First of all, I'd ask you whether or not optimisation is really necessary. Quite often you'll spend a lot of time looking for optimisations which, strictly speaking, aren't necessary. You may save a clock cycle here or a clock cycle there, but it's not noticeable.

As for optimisations, the most obvious one that I see lies here:
C#
if (Action[i, j] && !IsEmpty[sdx, sdy] && sdx == ftx && sdy == fty)
  return true;
Please though give your variables better names, and use { } to wrap code sections; I had real trouble wading through the logic.

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


AnswerRe: help optimize functions Pin
David198716-Jun-11 4:40
David198716-Jun-11 4:40 
GeneralRe: help optimize functions Pin
Abbath134916-Jun-11 6:34
Abbath134916-Jun-11 6:34 
GeneralRe: help optimize functions Pin
David198716-Jun-11 7:11
David198716-Jun-11 7:11 
QuestionFusion Logs not working for WINWORD.exe Pin
ramzg15-Jun-11 23:09
ramzg15-Jun-11 23:09 
QuestionQuery XML with LINQ Pin
treuveni15-Jun-11 21:26
treuveni15-Jun-11 21:26 
AnswerRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 21:31
mvePete O'Hanlon15-Jun-11 21:31 
GeneralRe: Query XML with LINQ Pin
treuveni15-Jun-11 21:37
treuveni15-Jun-11 21:37 
GeneralRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 21:42
mvePete O'Hanlon15-Jun-11 21:42 
GeneralRe: Query XML with LINQ Pin
treuveni15-Jun-11 21:50
treuveni15-Jun-11 21:50 
GeneralRe: Query XML with LINQ Pin
Pete O'Hanlon15-Jun-11 22:21
mvePete O'Hanlon15-Jun-11 22:21 
QuestionSearching words on visual studio. Pin
Subin Mavunkal15-Jun-11 21:05
Subin Mavunkal15-Jun-11 21:05 
AnswerRe: Searching words on visual studio. Pin
Richard MacCutchan15-Jun-11 21:18
mveRichard MacCutchan15-Jun-11 21:18 
Answer[SOLVED] OleDb Exception Displays Only Table Name Pin
Matt U.15-Jun-11 12:01
Matt U.15-Jun-11 12:01 
AnswerRe: OleDb Exception Displays Only Table Name Pin
AnnieMacD15-Jun-11 13:30
AnnieMacD15-Jun-11 13:30 
GeneralRe: OleDb Exception Displays Only Table Name Pin
Matt U.15-Jun-11 15:47
Matt U.15-Jun-11 15:47 
QuestionIs it possible to query a unix server (SAN) with c sharp? [modified] Pin
turbosupramk315-Jun-11 10:09
turbosupramk315-Jun-11 10:09 
AnswerRe: Is it possible to query a unix server (SAN) with c sharp? Pin
Not Active15-Jun-11 10:16
mentorNot Active15-Jun-11 10:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.