Skip to content

Reduce memory footprint of executable tsql #16

@LetsMelon

Description

@LetsMelon

At the current commit c3b5053 the ./src-folder contains 14 clone() method calls.

Things to do:

All clone()'s currently in the project
14 results - 3 files

src/lib.rs:
  25              Ok((c, table)) => {
  26:                 let c = c.to_string().clone();
  27  
  28:                 let name = table.name.clone();
  29                  raw_tables.insert(name, Rc::new(RefCell::new(table)));

src/types.rs:
   46          while let Some((name, table)) = get_first_element(&raw_tables) {
   47:             let name = name.clone();
   48:             let table = table.clone();
   49  

   56                      .iter()
   57:                     .map(|item| item.borrow().name.clone())
   58                      .collect::<Vec<_>>();

   83  
   84:             parsed.insert(parsed_table.name.clone(), parsed_table);
   85          }

   97  
   98:         parsed_table.name = raw.name.clone();
   99  

  104                          .fields
  105:                         .insert(raw_field.name.clone(), Field::parse(raw_field)?);
  106                  }

  122                          let field = Field {
  123:                             name: field_name.clone(),
  124                              datatype: fk_field.datatype,
  125                              foreign_key_reference: Some((
  126:                                 fk_table_name.clone(),
  127:                                 Rc::new(fk_field.clone()),
  128                              )),

  148                  .primary_key
  149:                 .push(primary_key_field.clone());
  150          }

  187                  .iter()
  188:                 .map(|item| item.foreign_key_reference.as_ref().unwrap().1.name.clone())
  189                  .collect::<Vec<_>>()

src/parser/types.rs:
  24                      RawDataType::ForeignKeyTable(table_name) => {
  25:                         table_names.push(table_name.clone())
  26                      }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions