They call that the geometric racing line and it might minimize the amount of time that it takes you to navigate one specific corner but if the corner is a hard braking zone followed by a long straight, your exit speed will likely be lower which will cost you time all the way to the next braking zone.

https://www.youtube.com/watch?v=uIbTPvHFf-w

https://driver61.com/uni/racing-line/