Results 1 to 6 of 6

Thread: [RESOLVED] Efficiency of If variations

Threaded View

  1. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Efficiency of If variations

    IsNullOrWhiteSpace does more than just Trim (it also deals with there being no string at all), so it is safer to use that.

    Both parts of your second code block are essentially the same, but can be made even simpler/faster:
    Code:
    blnAbFHR = rdoT4AbFHR1.Checked
    edit: I just noticed that the ElseIf refers to rdoT4AbFHR2 , was that a typo? (my comments were based on it being rdoT4AbFHR1)

    Quote Originally Posted by riechan View Post
    Also, are the following codes essentially the same?
    Code:
    If xx.Checked Then
    If xx.Checked = true Then
    Yes, and they probably compile to exactly the same thing (so the difference is the amount of typing/reading)
    Last edited by si_the_geek; Mar 16th, 2016 at 04:56 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width