Ticket #415 (closed enhancement: fixed)

Opened 15 years ago

Last modified 15 years ago

trivial optimization in src/file.c::panel_operate()

Reported by: slavazanko Owned by: slavazanko
Priority: trivial Milestone: 4.7
Component: mc-core Version: master
Keywords: commited-master Cc:
Blocked By: Blocking:
Branch state: Votes for changeset:

Description

Message from maillist.

From: Denys Vlasenko (vda).


I noticed an incorrectly indented if() in file.c::panel_operate().
Took a better look, and found out it can be tweaked in several ways.

This patch is the result.

It contains the following trivial optimizations:

  • merged two identical "dest_dir_ = g_strdup (dest_dir)" ops.
  • simplified check for trailing '/' (no need to strcmp 1-char string).
  • since g_free (NULL) is safe, merged two separate "if empty string then bail out" code paths.
  • fixed wording in a comment.

Attachments

2.patch (1.3 KB) - added by slavazanko 15 years ago.

Change History

Changed 15 years ago by slavazanko

comment:1 Changed 15 years ago by slavazanko

  • Keywords review vote-slavazanko added
  • Owner set to slavazanko
  • Status changed from new to accepted
  • Type changed from defect to enhancement

created branch 415_trivial_optimization (parent: master)

initial changeset:df256dbaf6521263108958666cda9ac4c3b15608

Review.

comment:2 Changed 15 years ago by andrew_b

  • Keywords vote-andrew_b approved added; review removed

comment:3 Changed 15 years ago by slavazanko

  • Status changed from accepted to testing
  • Keywords commited-master added; vote-slavazanko vote-andrew_b approved removed
  • Resolution set to fixed

comment:4 Changed 15 years ago by slavazanko

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.