浏览代码

use Debug.AssertFormat to avoid string formatting in DEBUG (#4879)

/MLA-1734-demo-provider
GitHub 4 年前
当前提交
9bb905da
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 7
      com.unity.ml-agents/Runtime/Sensors/SensorShapeValidator.cs

7
com.unity.ml-agents/Runtime/Sensors/SensorShapeValidator.cs


{
// Check for compatibility with the other Agents' Sensors
// TODO make sure this only checks once per agent
Debug.Assert(m_SensorShapes.Count == sensors.Count, $"Number of Sensors must match. {m_SensorShapes.Count} != {sensors.Count}");
Debug.AssertFormat(
m_SensorShapes.Count == sensors.Count,
"Number of Sensors must match. {0} != {1}",
m_SensorShapes.Count,
sensors.Count
);
for (var i = 0; i < Mathf.Min(m_SensorShapes.Count, sensors.Count); i++)
{
var cachedShape = m_SensorShapes[i];

正在加载...
取消
保存