mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
This makes the StringCordView iterator a variant holding either the existing implementation (when there is more than one piece) or a simple `std::string_view::iterator` (when there is only one piece). The latter seems to be significantly cheaper. Differential Revision: [D73379178](https://our.internmc.facebook.com/intern/diff/D73379178/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/151810 Approved by: https://github.com/Skylion007 ghstack dependencies: #151801, #151802, #151803, #151804, #151805, #151806, #151807