korbit-ai[bot] commented on code in PR #35992:
URL: https://github.com/apache/superset/pull/35992#discussion_r2492420984


##########
superset-frontend/src/SqlLab/actions/sqlLab.js:
##########
@@ -950,12 +950,13 @@ export function mergeTable(table, query, prepend) {
   return { type: MERGE_TABLE, table, query, prepend };
 }
 
-export function addTable(queryEditor, tableName, catalogName, schemaName) {
+export function addTable(queryEditor, tableName, catalogName, schemaName, 
expanded = true) {
   return function (dispatch, getState) {
     const { dbId } = getUpToDateQuery(getState(), queryEditor, queryEditor.id);
+    const queryEditorId = queryEditor.tabViewId ?? queryEditor.id;

Review Comment:
   ### Redundant computation elimination <sub>![category 
Performance](https://img.shields.io/badge/Performance-4f46e5)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The queryEditorId calculation is extracted to avoid duplicate computation of 
the nullish coalescing operator, which is a minor performance optimization.
   
   
   ###### Why this matters
   This change eliminates redundant property access and nullish coalescing 
evaluation, reducing computational overhead in the function execution.
   
   ###### Suggested change ∙ *Feature Preview*
   The code correctly extracts the repeated computation into a variable, which 
is already implemented in the diff. This is a positive performance change.
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice 
Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2dddc4b2-fb24-4cc8-aa45-52bd00170c69/upvote)
 
[![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2dddc4b2-fb24-4cc8-aa45-52bd00170c69?what_not_true=true)
  [![Not in 
Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2dddc4b2-fb24-4cc8-aa45-52bd00170c69?what_out_of_scope=true)
 [![Not in coding 
standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2dddc4b2-fb24-4cc8-aa45-52bd00170c69?what_not_in_standard=true)
 
[![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/2dddc4b2-fb24-4cc8-aa45-52bd00170c69)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:f1b0ffe7-310e-4e7b-a067-8ee12b64fa1b -->
   
   
   [](f1b0ffe7-310e-4e7b-a067-8ee12b64fa1b)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to