Homec4science

Load only valid properties in LiskDAO::loadFromArray()

Authored by epriestley <git@epriestley.com> on Oct 4 2012, 00:42.

Description

Load only valid properties in LiskDAO::loadFromArray()

Summary:
Fixes a TODO, and silences a warning introduced by D3601.

There are several cases where we load data like:

SELECT *, ... AS extraData FROM ...

...and then pass it to loadAllFromArray(). Currently, this causes us to set an extraData property on the object.

This idiom seems fairly useful and non-dangerous, so I made loadFromArray() just drop extra keys.

Since we hit this loop a potentially huge number of times (10,000+ for full Maniphest pages) I did some microoptimization. Lisk is hot enough that it's one of the few places where it's worthwhile (see D1291).

Test Plan: Loaded homepage, no longer got warnings about viewerIsMember from Project queries. Browsed ~10 apps, didn't see any issues.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3606

Details

Committed
epriestley <git@epriestley.com>Oct 4 2012, 00:42
Pushed
aubortJan 31 2017, 17:16
Parents
rPH270256d3363b: Restore flavor text to applications
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHfe6022cd97f5: Load only valid properties in LiskDAO::loadFromArray() (authored by epriestley <git@epriestley.com>).Oct 4 2012, 00:42