<commit_before>/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 <NAME>
 *
 * This library is open source and may be redistributed and/or modified under  
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * OpenSceneGraph Public License for more details.
*/
#include <osgUtil/Optimizer>

#include <osg/ApplicationUsage>
#include <osg/Transform>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/LOD>
#include <osg/Impostor>
#include <osg/Billboard>
#include <osg/Geometry>
#include <osg/Notify>
#include <osg/OccluderNode>
#include <osg/Sequence>
#include <osg/Switch>
#include <osg/Texture>

#include <osgUtil/TransformAttributeFunctor>
#include <osgUtil/TriStripVisitor>
#include <osgUtil/Tesselator>

#include <typeinfo>
#include <algorithm>
#include <numeric>

using namespace osgUtil;


////////////////////////////////////////////////////////////////////////////
// Overall Optimization function.
////////////////////////////////////////////////////////////////////////////

static bool isNodeEmpty(const osg::Node& node)
{
    if (node.getUserData()) return false;
    if (node.getUpdateCallback()) return false;
    if (node.getEventCallback()) return false;
    if (node.getCullCallback()) return false;
    if (node.getNumDescriptions()>0) return false;
    if (node.getStateSet()) return false;
    if (node.getNodeMask()!=0xffffffff) return false;
    return true;<commit_msg>Added check against node.getName() into isNodeEmpty(Node&) method so that nodes with names arn't assumed to be empty.<commit_after>/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 <NAME>
 *
 * This library is open source and may be redistributed and/or modified under  
 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
 * (at your option) any later version.  The full license is in LICENSE file
 * included with this distribution, and on the openscenegraph.org website.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 * OpenSceneGraph Public License for more details.
*/
#include <osgUtil/Optimizer>

#include <osg/ApplicationUsage>
#include <osg/Transform>
#include <osg/MatrixTransform>
#include <osg/PositionAttitudeTransform>
#include <osg/LOD>
#include <osg/Impostor>
#include <osg/Billboard>
#include <osg/Geometry>
#include <osg/Notify>
#include <osg/OccluderNode>
#include <osg/Sequence>
#include <osg/Switch>
#include <osg/Texture>

#include <osgUtil/TransformAttributeFunctor>
#include <osgUtil/TriStripVisitor>
#include <osgUtil/Tesselator>

#include <typeinfo>
#include <algorithm>
#include <numeric>

using namespace osgUtil;


////////////////////////////////////////////////////////////////////////////
// Overall Optimization function.
////////////////////////////////////////////////////////////////////////////

static bool isNodeEmpty(const osg::Node& node)
{
    if (node.getUserData()) return false;
    if (node.getUpdateCallback()) return false;
    if (node.getEventCallback()) return false;
    if (node.getCullCallback()) return false;
    if (node.getNumDescriptions()>0) return false;
    if (node.getStateSet()) return false;
    if (node.getNodeMask()!=0xffffffff) return false;
    if (!node.getName().empty()) return false;
    return true;
{'fraction_non_alphanumeric': 0.1800796812749004, 'fraction_numerical': 0.006374501992031873, 'mean_word_length': 3.189098998887653, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6312594', 'n_tokens_mistral': 1078, 'n_tokens_neox': 1051, 'n_words': 359}