Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
Y

yxhu

@yxhu
About
Posts
4
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Dear Programmers, Why do you hate me?
    Y yxhu

    In today's world, you shall not blame on programmers, this is the UX/UI job. Programmers simply implement what they have been asked to do.

    The Lounge help question

  • Performance Genius
    Y yxhu

    Lol... that was a typo. Thanks Adrian0. :thumbsup:

    The Weird and The Wonderful docker performance question announcement

  • Performance Genius
    Y yxhu

    Adrian0, unfortunately, your solution was invalid. As ++i will be calculated(increased) before accessing the element of data collection. container will never have data[0], plus you will receive an out of index exception at the final loop of this for expression. Say data collection has 4 elements. Each iteration looks like: Loop 1, i initialised = 0: container.Add(data[1]).Items Loop 2, i initialised = 1: container.Add(data[2]).Items Loop 3, i initialised = 2: container.Add(data[3]).Items Loop 3, i initialised = 3: container.Add(data[4]).Items <<< Exception here When i++ or ++i is within an expression, ++i has the highest priority to get executed bofere the reset of the expression. In contrast, i++ is get executed after the whole expression has been executed. container.Add(data[i++].Items) //Get the ith element of data collection, append to container and then increase i by 1 container.Add(data[++i].Items) //Increase i by 1, then get the 1th element of data collection to append to the container.

    The Weird and The Wonderful docker performance question announcement

  • Performance Genius
    Y yxhu

    improved version of above can be like: for ( int i = 0; i < data.Count; container.Add(data[i++].Items)

    The Weird and The Wonderful docker performance question announcement
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups