Auto merge of #17683 - birtles:tidy-list-length-check, r=emilio

Tidy up check for zero-length lists when interpolating

<!-- Please describe your changes on the following line: -->
Address feedback from https://github.com/servo/servo/pull/17613#discussion_r125775874

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because they are a code tidy up only with no functional changes.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17683)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-12 01:22:26 -07:00 committed by GitHub
commit 76e2af4420

View file

@ -826,7 +826,7 @@ macro_rules! repeated_vec_impl {
fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64)
-> Result<Self, ()> {
// If the length of either list is zero, the least common multiple is undefined.
if cmp::min(self.len(), other.len()) < 1 {
if self.is_empty() || other.is_empty() {
return Err(());
}
use num_integer::lcm;