PR #10341: Use vec.data() instead of &vec[0]
PR #10341: Use vec.data() instead of &vec[0]

Imported from GitHub PR https://github.com/openxla/xla/pull/10341

I noticed that we use address of the first element of the vector to get pointer of the internal buffer - that is a known style "issue" in CodeChecker / clang-tidy. 

_'data' should be used for accessing the data pointer instead of taking the address of the 0-th element_

## readability-container-data-pointer
Finds cases where code could use data() rather than the address of the element at index 0 in a container. This pattern is commonly used to materialize a pointer to the backing data of a container. std::vector and std::string provide a data() accessor to retrieve the data pointer which should be preferred.

This also ensures that in the case that the container is empty, the data pointer access does not perform an errant memory access.

https://clang.llvm.org/extra/clang-tidy/checks/readability/container-data-pointer.html


Copybara import of the project:

--
3f37e3dc17483f4e49fd86add9276183d0b78a65 by Alexander Pivovarov <pivovaa@amazon.com>:

Use vec.data() instead of &vec[0]

Merging this change closes #10341

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/10341 from apivovarov:ptr_to_elem_zero 3f37e3dc17483f4e49fd86add9276183d0b78a65
