When the parameter user_limit is 0, we dont need to call file_space_used.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 197266.patch | 1.03 KB | drewish |
| #11 | file_197266.patch | 2.01 KB | drewish |
| #5 | 197266-2.patch | 1.89 KB | c960657 |
| #4 | 197266.file_validate_size.patch | 1.31 KB | dave reid |
| #2 | file.inc_.quota_2.patch | 1.23 KB | lilou |
Comments
Comment #1
drewish commentedComment #2
lilou commentedReroll.
Comment #3
drewish commenteda small change to help avoid an extra query.
Comment #4
dave reidLooks like you're missing a closing brace on that if statement. Also please use cvs diff -uP so we can get the relevant function name in the diff. Here's a revised patch that also fixes the PHP doc for $user_limit.
Comment #5
c960657 commentedReroll. file_validate_size() is already covered by unit tests.
Comment #7
drewish commentedignore DrupalTestbedBot it's buggy: #307197: Testing the incorrect patch posting multiple comments.
Comment #8
drewish commentedjust re-ran the tests, they're still good. simple enough patch too.
Comment #9
webchickThanks, committed! Looks like this could go in 6.x too.
Comment #10
gábor hojtsyLooks like a good improvement. However (1) it does not apply to Drupal 6 (2) I'd add a comment to the if() which would explain that the function call is in there to help performance a bit. Otherwise someone might go and "prettify" if later on.
Comment #11
drewish commentedhow's this look?
Comment #12
c960657 commentedLooks good.
Comment #13
gábor hojtsyCommitted to Drupal 6. Let's get that added comment to Drupal 7 too.
Comment #14
drewish commentedhere's that comment for D7
Comment #15
dries commentedCommitted to CVS HEAD.
Comment #16
ufku commentedAccording to the comment
"when a limit is provided we save a query by only calling file_space_used()"
Should't we
"save a query by not calling file_space_used when there is no user limit."
I mean the current comment is incoherent.
Or is it time to go to bed for me?