mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #5801 - Ms2ger:range, r=pcwalton
<!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5801) <!-- Reviewable:end -->
This commit is contained in:
commit
43e664cda1
17 changed files with 27 additions and 28 deletions
|
@ -1049,7 +1049,7 @@ class CGArgumentConverter(CGThing):
|
|||
|
||||
variadicConversion = string.Template(
|
||||
"let mut vector: ${seqType} = Vec::with_capacity((${argc} - ${index}) as usize);\n"
|
||||
"for variadicArg in range(${index}, ${argc}) {\n"
|
||||
"for variadicArg in ${index}..${argc} {\n"
|
||||
"${inner}\n"
|
||||
" vector.push(slot);\n"
|
||||
"}\n"
|
||||
|
@ -5157,7 +5157,7 @@ class CallbackMember(CGNativeMember):
|
|||
successCode="")
|
||||
if arg.variadic:
|
||||
conversion = string.Template(
|
||||
"for idx in range(0, ${arg}.len()) {\n" +
|
||||
"for idx in 0..${arg}.len() {\n" +
|
||||
CGIndenter(CGGeneric(conversion)).define() + "\n"
|
||||
"}"
|
||||
).substitute({ "arg": arg.identifier.name })
|
||||
|
|
|
@ -473,7 +473,7 @@ pub fn find_enum_string_index(cx: *mut JSContext,
|
|||
|
||||
Ok(values.iter().position(|value| {
|
||||
value.len() == length as usize &&
|
||||
range(0, length as usize).all(|j| {
|
||||
(0..length as usize).all(|j| {
|
||||
value.as_bytes()[j] as u16 == *chars.offset(j as isize)
|
||||
})
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue