# UNT0002 Inefficient tag comparison Comparing tags using == is slower than using the built-in CompareTag method. ## Examples of patterns that are flagged by this analyzer ```csharp using UnityEngine; public class Camera : MonoBehaviour { private void Update() { Debug.Log(tag == "tag1"); } } ``` ## Solution Use CompareTag method: ```csharp using UnityEngine; public class Camera : MonoBehaviour { private void Update() { Debug.Log(CompareTag("tag1")); } } ``` A code fix is offered for this diagnostic to automatically apply this change.