Skip to content
Snippets Groups Projects
  1. Nov 06, 2019
  2. Nov 05, 2019
  3. Oct 30, 2019
  4. Oct 29, 2019
  5. Oct 26, 2019
  6. Oct 25, 2019
    • AdminXVII's avatar
    • AdminXVII's avatar
      Apply clippy lints and refactor loops for easier understanding · 10dd15d8
      AdminXVII authored
      - Use clippy to improve the code's clarity and efficiency.
      - Refactor loops
      
      Try to avoid `loop`s with `break`s when it can be replaced with
      while/for loops.
      
      One of the most encountered loop style is:
      ```rust
      if ecm.entity_store().children[&entity].len() > 0 {
        let mut index = 0;
      
        loop {
          let child = ecm.entity_store().children[&entity][index];
          // ...
      
          if index + 1 < ecm.entity_store().children[&entity].len() {
              index += 1;
          } else {
              break;
          }
        }
      }
      ```
      The check can be without any impact be done at the loop start:
      ```rust
      if ecm.entity_store().children[&entity].len() > 0 {
        let mut index = 0;
      
        while index < ecm.entity_store().children[&entity].len() {
          let child = ecm.entity_store().children[&entity][index];
          // ...
      
          index += 1;
        }
      }
      ```
      Then the if is redundant:
      ```rust
      let mut index = 0;
      
      while index < ecm.entity_store().children[&entity].len() {
        let child = ecm.entity_store().children[&entity][index];
        // ...
      
        index += 1;
      }
      ```
      and given that no children is added inside the loop, this is equivalent
      to
      ```rust
      for index in 0..ecm.entity_store().children[&entity].len() {
        let child = ecm.entity_store().children[&entity][index];
        // ...
      }
      ```
      10dd15d8
    • Florian Blasius's avatar
      Wip proeprties. · ebc86f79
      Florian Blasius authored
      ebc86f79
    • Florian Blasius's avatar
      Refactor attached properties. · 6b19c7bc
      Florian Blasius authored
      6b19c7bc
  7. Oct 24, 2019
  8. Oct 21, 2019
  9. Oct 18, 2019
  10. Oct 16, 2019
  11. Oct 15, 2019
  12. Oct 14, 2019
  13. Oct 12, 2019
  14. Oct 11, 2019
  15. Oct 10, 2019
  16. Oct 08, 2019
  17. Oct 07, 2019
  18. Oct 04, 2019
  19. Oct 02, 2019
Loading