Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#3896 closed Enhancement (fixed)

Remove a redundant call to tr_torrentStat() in tr_core_update()

Reported by: jordan Owned by: jordan
Priority: Normal Milestone: 2.20
Component: GTK+ Client Version: 2.13
Severity: Minor Keywords: backport-2.1x backport-2.0x
Cc:

Description

tr_core_updates()'s worker function calls update_foreach() to update each row in the torrent model. This function calls tr_torrentStat(), which is somewhat expensive. It also calls a private static function, torrentIsActive(), which also calls tr_torrentStat() and only looks at the stat's fields.

By replacing torrentIsActive()'s tr_torrent* argument with a tr_stat* argument, we can cut the number of calls to tr_torrentStat() in half.

Change History (3)

comment:1 Changed 11 years ago by jordan

  • Keywords backport-2.1x backport-2.0x added
  • Status changed from new to assigned

Fixed in r11670

comment:2 Changed 11 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:3 Changed 11 years ago by jordan

  • Summary changed from Redundant call to tr_torrentStat() in tr_core_update() to Remove a redundant call to tr_torrentStat() in tr_core_update()
  • Type changed from Bug to Enhancement
Note: See TracTickets for help on using tickets.