Closed Bug 1036290 Opened 6 years ago Closed 6 years ago

Use nsAutoTArray for copying TouchArray

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla33

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #3)
> Comment on attachment 8452191 [details] [diff] [review]
> Use mozilla::WidgetTouchEvent::TouchArray instead of
> nsTArry<nsRefPtr<mozilla::dom::Touch>>
> 
> Review of attachment 8452191 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> You could use "auto" in some of these places too.
Attached patch PatchSplinter Review
Attachment #8452966 - Flags: review?(roc)
Comment on attachment 8452966 [details] [diff] [review]
Patch

Review of attachment 8452966 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry, no; I meant the C++ "auto" feature for declaring the types of local variables.
Attachment #8452966 - Flags: review?(roc) → review-
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #2)
> Comment on attachment 8452966 [details] [diff] [review]
> Patch
> 
> Review of attachment 8452966 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Sorry, no; I meant the C++ "auto" feature for declaring the types of local
> variables.

Oh... But anyway, isn't it better to use nsAutoTArray in the cases of the patch?
Flags: needinfo?(roc)
Comment on attachment 8452966 [details] [diff] [review]
Patch

Review of attachment 8452966 [details] [diff] [review]:
-----------------------------------------------------------------

Yes, you're right.
Attachment #8452966 - Flags: review- → review+
(I give r- in general for code using auto. It makes code faster to write but harder to read, and
I prefer good readability.)
I agree with Smaug. If other developers use "auto" in a lot of places, we need to check its definition of every variable. So, I think that we shouldn't use "auto" as far as possible. Although, it might be better to use in template.
Flags: needinfo?(roc)
https://hg.mozilla.org/mozilla-central/rev/19663c22e7eb
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.