Remove extra loop in view_assigns (#38766)
Remove extra loop in view_assigns (#38766)

* Remove extra loop in view_assigns

* Use slice instead of range
starknx/rails,Envek/rails,starknx/rails,yahonda/rails,joonyou/rails,Stellenticket/rails,gauravtiwari/rails,rafaelfranca/omg-rails,schuetzm/rails,tjschuck/rails,kddeisz/rails,vipulnsward/rails,yalab/rails,georgeclaghorn/rails,Edouard-chin/rails,betesh/rails,MSP-Greg/rails,bogdanvlviv/rails,eileencodes/rails,vipulnsward/rails,yawboakye/rails,repinel/rails,esparta/rails,yahonda/rails,betesh/rails,EmmaB/rails-1,mechanicles/rails,lcreid/rails,kmcphillips/rails,mechanicles/rails,tgxworld/rails,rails/rails,tjschuck/rails,tgxworld/rails,palkan/rails,schuetzm/rails,gauravtiwari/rails,EmmaB/rails-1,BlakeWilliams/rails,Erol/rails,Erol/rails,iainbeeston/rails,kmcphillips/rails,repinel/rails,MSP-Greg/rails,yawboakye/rails,BlakeWilliams/rails,rafaelfranca/omg-rails,iainbeeston/rails,Edouard-chin/rails,Stellenticket/rails,betesh/rails,tjschuck/rails,yahonda/rails,yalab/rails,Vasfed/rails,MSP-Greg/rails,Envek/rails,yalab/rails,rafaelfranca/omg-rails,schuetzm/rails,eileencodes/rails,Vasfed/rails,joonyou/rails,georgeclaghorn/rails,Edouard-chin/rails,rails/rails,schuetzm/rails,Erol/rails,BlakeWilliams/rails,Envek/rails,vipulnsward/rails,yhirano55/rails,vipulnsward/rails,iainbeeston/rails,betesh/rails,joonyou/rails,rails/rails,yhirano55/rails,eileencodes/rails,palkan/rails,bogdanvlviv/rails,kmcphillips/rails,tgxworld/rails,mechanicles/rails,EmmaB/rails-1,eileencodes/rails,yahonda/rails,lcreid/rails,bogdanvlviv/rails,mechanicles/rails,esparta/rails,kddeisz/rails,Vasfed/rails,joonyou/rails,Stellenticket/rails,bogdanvlviv/rails,tjschuck/rails,iainbeeston/rails,esparta/rails,MSP-Greg/rails,repinel/rails,Vasfed/rails,Edouard-chin/rails,kmcphillips/rails,tgxworld/rails,repinel/rails,yhirano55/rails,georgeclaghorn/rails,rails/rails,starknx/rails,yawboakye/rails,yalab/rails,lcreid/rails,gauravtiwari/rails,Erol/rails,kddeisz/rails,yhirano55/rails,kddeisz/rails,Envek/rails,georgeclaghorn/rails,Stellenticket/rails,yawboakye/rails,BlakeWilliams/rails,esparta/rails,lcreid/rails,palkan/rails,palkan/rails