Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Case (Speed) of

  1. #11
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Case (Speed) of

    So in short the case statement is WAY faster than a bunch of if statements.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  2. #12
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Case (Speed) of

    cool
    NecroSOFT - End of line -

  3. #13

    Case (Speed) of

    If you have 255 unique symbols/whatever inside a case statement, (if that's what you mean) i'd make some simple optimalization beforehand to eliminate the lot you don't need, i'd never make a case statement with more than let's say.. 25 entries. Some might say it becomes unreadable then! So not a question of speed but of nice looking code :lol:
    Marmin^.Style

  4. #14

    Case (Speed) of

    It is often better not to hand-optimize case statements. Free Pascal definately knows how to handle a case statement with 255 entries efficiently.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •